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 AsRef<Ident> for IdentString
impl AsRef<Ident> for IdentString
sourceimpl AsRef<str> for IdentString
impl AsRef<str> for IdentString
sourceimpl Clone for IdentString
impl Clone for IdentString
sourcefn clone(&self) -> IdentString
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
sourcefn from(ident: Ident) -> IdentString
fn from(ident: Ident) -> IdentString
Converts to this type from the input type.
sourceimpl From<IdentString> for String
impl From<IdentString> for String
sourcefn from(v: IdentString) -> String
fn from(v: IdentString) -> String
Converts to this type from the input type.
sourceimpl From<IdentString> for Ident
impl From<IdentString> for Ident
sourcefn from(v: IdentString) -> Ident
fn from(v: IdentString) -> Ident
Converts to this type from the input type.
sourceimpl FromMeta for IdentString
impl FromMeta for IdentString
sourcefn from_meta(item: &Meta) -> Result<IdentString, Error>
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_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
sourcefn partial_cmp(&self, other: &IdentString) -> Option<Ordering>
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
sourcefn to_tokens(&self, tokens: &mut TokenStream)
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 · sourcefn borrow_mut(&mut self) -> &mut T
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,
sourcefn span(&self) -> Span
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.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more