Struct darling::util::IdentString [−][src]
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.
Implementations
impl IdentString
[src]
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 Clone 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 From<Ident> for IdentString
[src]
impl From<Ident> for IdentString
[src]pub fn from(ident: Ident) -> IdentString
[src]
impl From<IdentString> for Ident
[src]
impl From<IdentString> for Ident
[src]pub fn from(v: IdentString) -> Ident
[src]
impl From<IdentString> for String
[src]
impl From<IdentString> for String
[src]pub fn from(v: IdentString) -> String
[src]
impl FromMeta for IdentString
[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]
impl Hash for IdentString
[src]impl Ord for IdentString
[src]
impl Ord for IdentString
[src]impl<'a> PartialEq<&'a str> for IdentString
[src]
impl<'a> PartialEq<&'a str> for IdentString
[src]impl PartialEq<IdentString> for IdentString
[src]
impl PartialEq<IdentString> for IdentString
[src]impl PartialEq<String> for IdentString
[src]
impl PartialEq<String> for IdentString
[src]impl PartialOrd<IdentString> for IdentString
[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 lt(&self, other: &Rhs) -> bool#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn le(&self, other: &Rhs) -> bool#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn gt(&self, other: &Rhs) -> bool#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ge(&self, other: &Rhs) -> boolimpl ToTokens for IdentString
[src]
impl ToTokens for IdentString
[src]