Struct darling::util::IdentString [−][src]
A wrapper for an Ident
which also keeps the value as a string.
This struct can be used to perform string comparisons and operations.
Implementations
impl IdentString
[src][−]
pub fn new(ident: Ident) -> IdentString
[src][−]
Create a new IdentString
.
pub fn as_ident(&self) -> &Ident
[src][−]
Get the ident as a proc_macro2::Ident
.
pub fn as_str(&self) -> &str
[src][−]
Get the ident as a string.
pub fn span(&self) -> Span
[src][−]
Get the location of this Ident
in source.
pub fn map<F, S>(self, map_fn: F) -> IdentString where
F: FnOnce(String) -> S,
S: AsRef<str>,
[src][−]
F: FnOnce(String) -> S,
S: AsRef<str>,
Apply some transform to the ident’s string representation.
Panics
This will panic if the transform produces an invalid ident.
Trait Implementations
impl AsRef<Ident> for IdentString
[src][+]
impl AsRef<str> for IdentString
[src][+]
impl Clone for IdentString
[src][+]
impl Debug for IdentString
[src][+]
impl Display for IdentString
[src][+]
impl Eq for IdentString
[src]
impl From<Ident> for IdentString
[src][+]
impl From<IdentString> for String
[src][+]
impl From<IdentString> for Ident
[src][+]
impl FromMeta for IdentString
[src][+]
impl Hash for IdentString
[src][+]
impl Ord for IdentString
[src][+]
impl<'a> PartialEq<&'a str> for IdentString
[src][+]
impl PartialEq<IdentString> for IdentString
[src][+]
impl PartialEq<String> for IdentString
[src][+]
impl PartialOrd<IdentString> for IdentString
[src][+]
impl ToTokens for IdentString
[src][+]
Auto Trait Implementations
impl RefUnwindSafe for IdentString
impl !Send for IdentString
impl !Sync for IdentString
impl Unpin for IdentString
impl UnwindSafe for IdentString
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> Spanned for T where
T: Spanned + ?Sized,
[src][+]
T: Spanned + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src][+]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,