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§
source§impl IdentString
impl IdentString
sourcepub fn new(ident: Ident) -> IdentString
pub fn new(ident: Ident) -> IdentString
Create a new IdentString
.
Trait Implementations§
source§impl AsRef<Ident> for IdentString
impl AsRef<Ident> for IdentString
source§impl AsRef<str> for IdentString
impl AsRef<str> for IdentString
source§impl Clone for IdentString
impl Clone for IdentString
source§fn clone(&self) -> IdentString
fn clone(&self) -> IdentString
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for IdentString
impl Debug for IdentString
source§impl Display for IdentString
impl Display for IdentString
source§impl From<Ident> for IdentString
impl From<Ident> for IdentString
source§fn from(ident: Ident) -> IdentString
fn from(ident: Ident) -> IdentString
Converts to this type from the input type.
source§impl From<IdentString> for Ident
impl From<IdentString> for Ident
source§fn from(v: IdentString) -> Ident
fn from(v: IdentString) -> Ident
Converts to this type from the input type.
source§impl From<IdentString> for String
impl From<IdentString> for String
source§fn from(v: IdentString) -> String
fn from(v: IdentString) -> String
Converts to this type from the input type.
source§impl FromMeta for IdentString
impl FromMeta for IdentString
source§fn 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 morefn from_nested_meta(item: &NestedMeta) -> Result<Self, Error>
source§fn 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 moresource§fn 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.
source§fn 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.
source§fn 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 morefn from_expr(expr: &Expr) -> Result<Self, Error>
source§fn 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.
source§impl Hash for IdentString
impl Hash for IdentString
source§impl Ord for IdentString
impl Ord for IdentString
source§fn cmp(&self, other: &IdentString) -> Ordering
fn cmp(&self, other: &IdentString) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'a> PartialEq<&'a str> for IdentString
impl<'a> PartialEq<&'a str> for IdentString
source§impl PartialEq<String> for IdentString
impl PartialEq<String> for IdentString
source§impl PartialEq for IdentString
impl PartialEq for IdentString
source§impl PartialOrd for IdentString
impl PartialOrd for IdentString
source§impl ToTokens for IdentString
impl ToTokens for IdentString
source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
impl Eq for IdentString
Auto Trait Implementations§
impl Freeze for IdentString
impl RefUnwindSafe for IdentString
impl !Send for IdentString
impl !Sync for IdentString
impl Unpin for IdentString
impl UnwindSafe for IdentString
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
source§fn 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.