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]
pub fn clone(&self) -> IdentString
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for IdentString
[src]
impl Display for IdentString
[src]
impl Eq for IdentString
[src]
impl From<Ident> for IdentString
[src]
pub fn from(ident: Ident) -> IdentString
[src]
impl From<IdentString> for String
[src]
pub fn from(v: IdentString) -> String
[src]
impl From<IdentString> for Ident
[src]
pub fn from(v: IdentString) -> Ident
[src]
impl FromMeta for IdentString
[src]
pub fn from_meta(item: &Meta) -> Result<IdentString, Error>
[src]
pub fn from_nested_meta(item: &NestedMeta) -> Result<Self, Error>
[src]
pub fn from_word() -> Result<Self, Error>
[src]
pub fn from_list(items: &[NestedMeta]) -> Result<Self, Error>
[src]
pub fn from_value(value: &Lit) -> Result<Self, Error>
[src]
pub fn from_char(value: char) -> Result<Self, Error>
[src]
pub fn from_string(value: &str) -> Result<Self, Error>
[src]
pub fn from_bool(value: bool) -> Result<Self, Error>
[src]
impl Hash for IdentString
[src]
pub fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for IdentString
[src]
pub fn cmp(&self, other: &IdentString) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<'a> PartialEq<&'a str> for IdentString
[src]
impl PartialEq<IdentString> for IdentString
[src]
pub fn eq(&self, rhs: &IdentString) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<String> for IdentString
[src]
pub fn eq(&self, rhs: &String) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<IdentString> for IdentString
[src]
pub fn partial_cmp(&self, other: &IdentString) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl ToTokens for IdentString
[src]
pub fn to_tokens(&self, tokens: &mut TokenStream)
[src]
pub fn to_token_stream(&self) -> TokenStream
[src]
pub fn into_token_stream(self) -> TokenStream
[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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
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,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,