Enum amplify_syn::ArgValue [−][src]
Expand description
Value for attribute or attribute argument, i.e. for #[attr = value]
and
#[attr(arg = value)]
this is the value
part of the attribute. Can be
either a single literal or a single valid rust type name
Variants
Literal(Lit)
Attribute value represented by a literal
Type(Type)
Attribute value represented by a type name
No value is given
Implementations
impl ArgValue
[src]
impl ArgValue
[src]pub fn literal_value(&self) -> Result<Lit, Error>
[src]
pub fn literal_value(&self) -> Result<Lit, Error>
[src]Returns literal value for ArgValue::Literal
variant or fails with
Error::ArgValueMustBeLiteral
otherwise
pub fn type_value(&self) -> Result<Type, Error>
[src]
pub fn type_value(&self) -> Result<Type, Error>
[src]Returns type value for ArgValue::Type
variant or fails with
Error::ArgValueMustBeType
otherwise
pub fn is_none(&self) -> bool
[src]
pub fn is_none(&self) -> bool
[src]Tests whether the self is set to ArgValue::None
pub fn is_some(&self) -> bool
[src]
pub fn is_some(&self) -> bool
[src]Tests whether the self is not set to ArgValue::None
pub fn value_class(&self) -> Option<ValueClass>
[src]
pub fn value_class(&self) -> Option<ValueClass>
[src]Returns ValueClass
for the current value, if any
Trait Implementations
impl From<Option<LitByteStr>> for ArgValue
[src]
impl From<Option<LitByteStr>> for ArgValue
[src]fn from(val: Option<LitByteStr>) -> Self
[src]
fn from(val: Option<LitByteStr>) -> Self
[src]Performs the conversion.
impl ToTokens for ArgValue
[src]
impl ToTokens for ArgValue
[src]fn to_tokens(&self, tokens: &mut TokenStream)
[src]
fn to_tokens(&self, tokens: &mut TokenStream)
[src]Write self
to the given TokenStream
. Read more
fn to_token_stream(&self) -> TokenStream
[src]
fn to_token_stream(&self) -> TokenStream
[src]Convert self
directly into a TokenStream
object. Read more
fn into_token_stream(self) -> TokenStream
[src]
fn into_token_stream(self) -> TokenStream
[src]Convert self
directly into a TokenStream
object. Read more
impl TryInto<LitByteStr> for ArgValue
[src]
impl TryInto<LitByteStr> for ArgValue
[src]impl TryInto<Option<LitByteStr>> for ArgValue
[src]
impl TryInto<Option<LitByteStr>> for ArgValue
[src]Auto Trait Implementations
impl RefUnwindSafe for ArgValue
impl !Send for ArgValue
impl !Sync for ArgValue
impl Unpin for ArgValue
impl UnwindSafe for ArgValue
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Spanned for T where
T: Spanned + ?Sized,
[src]
impl<T> Spanned for T where
T: Spanned + ?Sized,
[src]pub fn span(&self) -> Span
[src]
pub fn span(&self) -> Span
[src]Returns a Span
covering the complete contents of this syntax tree
node, or Span::call_site()
if this node is empty. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more