[][src]Struct darling::util::IdentString

pub struct IdentString { /* fields omitted */ }

A wrapper for an Ident which also keeps the value as a string.

This struct can be used to perform string comparisons and operations.

Methods

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]

Apply some transform to the ident's string representation.

Panics

This will panic if the transform produces an invalid ident.

Trait Implementations

impl PartialOrd<IdentString> for IdentString[src]

impl ToTokens for IdentString[src]

impl From<Ident> for IdentString[src]

impl From<IdentString> for String[src]

impl From<IdentString> for Ident[src]

impl Clone for IdentString[src]

impl Debug for IdentString[src]

impl Ord for IdentString[src]

impl<'a> PartialEq<&'a str> for IdentString[src]

impl PartialEq<String> for IdentString[src]

impl PartialEq<IdentString> for IdentString[src]

impl Eq for IdentString[src]

impl AsRef<str> for IdentString[src]

impl AsRef<Ident> for IdentString[src]

impl Hash for IdentString[src]

impl Display for IdentString[src]

impl FromMeta for IdentString[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]