Struct darling::util::IdentString
source · [−]pub struct IdentString { /* private fields */ }
Expand description
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
sourceimpl IdentString
impl IdentString
sourcepub fn new(ident: Ident) -> IdentString
pub fn new(ident: Ident) -> IdentString
Create a new IdentString
.
Trait Implementations
sourceimpl Clone for IdentString
impl Clone for IdentString
sourcepub fn clone(&self) -> IdentString
pub fn clone(&self) -> IdentString
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for IdentString
impl Debug for IdentString
sourceimpl Display for IdentString
impl Display for IdentString
sourceimpl From<Ident> for IdentString
impl From<Ident> for IdentString
sourcepub fn from(ident: Ident) -> IdentString
pub fn from(ident: Ident) -> IdentString
Performs the conversion.
sourceimpl From<IdentString> for Ident
impl From<IdentString> for Ident
sourcepub fn from(v: IdentString) -> Ident
pub fn from(v: IdentString) -> Ident
Performs the conversion.
sourceimpl From<IdentString> for String
impl From<IdentString> for String
sourcepub fn from(v: IdentString) -> String
pub fn from(v: IdentString) -> String
Performs the conversion.
sourceimpl FromMeta for IdentString
impl FromMeta for IdentString
sourcepub fn from_meta(item: &Meta) -> Result<IdentString, Error>
pub fn from_meta(item: &Meta) -> Result<IdentString, Error>
Create an instance from a syn::Meta
by dispatching to the format-appropriate
trait function. This generally should not be overridden by implementers. Read more
fn from_nested_meta(item: &NestedMeta) -> Result<Self, Error>
sourcefn from_none() -> Option<Self>
fn from_none() -> Option<Self>
When a field is omitted from a parent meta-item, from_none
is used to attempt
recovery before a missing field error is generated. Read more
sourcefn from_word() -> Result<Self, Error>
fn from_word() -> Result<Self, Error>
Create an instance from the presence of the word in the attribute with no additional options specified. Read more
sourcefn from_list(items: &[NestedMeta]) -> Result<Self, Error>
fn from_list(items: &[NestedMeta]) -> Result<Self, Error>
Create an instance from a list of nested meta items.
sourcefn from_value(value: &Lit) -> Result<Self, Error>
fn from_value(value: &Lit) -> Result<Self, Error>
Create an instance from a literal value of either foo = "bar"
or foo("bar")
.
This dispatches to the appropriate method based on the type of literal encountered,
and generally should not be overridden by implementers. Read more
sourcefn from_char(value: char) -> Result<Self, Error>
fn from_char(value: char) -> Result<Self, Error>
Create an instance from a char literal in a value position.
sourcefn from_string(value: &str) -> Result<Self, Error>
fn from_string(value: &str) -> Result<Self, Error>
Create an instance from a string literal in a value position.
sourceimpl Hash for IdentString
impl Hash for IdentString
sourceimpl Ord for IdentString
impl Ord for IdentString
sourceimpl<'a> PartialEq<&'a str> for IdentString
impl<'a> PartialEq<&'a str> for IdentString
sourceimpl PartialEq<IdentString> for IdentString
impl PartialEq<IdentString> for IdentString
sourceimpl PartialEq<String> for IdentString
impl PartialEq<String> for IdentString
sourceimpl PartialOrd<IdentString> for IdentString
impl PartialOrd<IdentString> for IdentString
sourcepub fn partial_cmp(&self, other: &IdentString) -> Option<Ordering>
pub fn partial_cmp(&self, other: &IdentString) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl ToTokens for IdentString
impl ToTokens for IdentString
sourcepub fn to_tokens(&self, tokens: &mut TokenStream)
pub fn to_tokens(&self, tokens: &mut TokenStream)
Write self
to the given TokenStream
. Read more
sourcefn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Convert self
directly into a TokenStream
object. Read more
sourcefn into_token_stream(self) -> TokenStream
fn into_token_stream(self) -> TokenStream
Convert self
directly into a TokenStream
object. Read more
impl Eq for IdentString
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Spanned for T where
T: Spanned + ?Sized,
impl<T> Spanned for T where
T: Spanned + ?Sized,
sourcepub fn span(&self) -> Span
pub fn span(&self) -> Span
Returns a Span
covering the complete contents of this syntax tree
node, or Span::call_site()
if this node is empty. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more