Struct darling_core::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) -> Self
[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) -> Self 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]fn clone(&self) -> IdentString
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl From<IdentString> for Ident
[src]
impl From<IdentString> for Ident
[src]fn from(v: IdentString) -> Ident
[src]
impl From<IdentString> for String
[src]
impl From<IdentString> for String
[src]fn from(v: IdentString) -> String
[src]
impl FromMeta for IdentString
[src]
impl FromMeta for IdentString
[src]fn from_meta(item: &Meta) -> Result<Self>
[src]
fn from_nested_meta(item: &NestedMeta) -> Result<Self>
[src]
fn from_word() -> Result<Self>
[src]
fn from_list(items: &[NestedMeta]) -> Result<Self>
[src]
fn from_value(value: &Lit) -> Result<Self>
[src]
fn from_char(value: char) -> Result<Self>
[src]
fn from_string(value: &str) -> Result<Self>
[src]
fn from_bool(value: bool) -> Result<Self>
[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]impl ToTokens for IdentString
[src]
impl ToTokens for IdentString
[src]