Enum amplify_syn::ArgValue[][src]

pub enum ArgValue {
    Literal(Lit),
    Type(Type),
    None,
}
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

None

No value is given

Implementations

impl ArgValue[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]

Returns type value for ArgValue::Type variant or fails with Error::ArgValueMustBeType otherwise

pub fn is_none(&self) -> bool[src]

Tests whether the self is set to ArgValue::None

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]

Returns ValueClass for the current value, if any

Trait Implementations

impl Clone for ArgValue[src]

fn clone(&self) -> ArgValue[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for ArgValue[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl From<&'_ [u8]> for ArgValue[src]

fn from(val: &[u8]) -> Self[src]

Performs the conversion.

impl From<&'_ str> for ArgValue[src]

fn from(val: &str) -> Self[src]

Performs the conversion.

impl From<Ident> for ArgValue[src]

fn from(ident: Ident) -> Self[src]

Performs the conversion.

impl From<Option<LitBool>> for ArgValue[src]

fn from(val: Option<LitBool>) -> Self[src]

Performs the conversion.

impl From<Option<LitByteStr>> for ArgValue[src]

fn from(val: Option<LitByteStr>) -> Self[src]

Performs the conversion.

impl From<Option<LitChar>> for ArgValue[src]

fn from(val: Option<LitChar>) -> Self[src]

Performs the conversion.

impl From<Option<LitFloat>> for ArgValue[src]

fn from(val: Option<LitFloat>) -> Self[src]

Performs the conversion.

impl From<Option<LitInt>> for ArgValue[src]

fn from(val: Option<LitInt>) -> Self[src]

Performs the conversion.

impl From<Option<LitStr>> for ArgValue[src]

fn from(val: Option<LitStr>) -> Self[src]

Performs the conversion.

impl From<Path> for ArgValue[src]

fn from(path: Path) -> Self[src]

Performs the conversion.

impl From<String> for ArgValue[src]

fn from(val: String) -> Self[src]

Performs the conversion.

impl From<Vec<u8, Global>> for ArgValue[src]

fn from(val: Vec<u8>) -> Self[src]

Performs the conversion.

impl From<char> for ArgValue[src]

fn from(val: char) -> Self[src]

Performs the conversion.

impl From<f64> for ArgValue[src]

fn from(val: f64) -> Self[src]

Performs the conversion.

impl From<isize> for ArgValue[src]

fn from(val: isize) -> Self[src]

Performs the conversion.

impl From<usize> for ArgValue[src]

fn from(val: usize) -> Self[src]

Performs the conversion.

impl Parse for ArgValue[src]

fn parse(input: &ParseBuffer<'_>) -> Result<Self>[src]

impl ToTokens for ArgValue[src]

fn to_tokens(&self, tokens: &mut TokenStream)[src]

Write self to the given TokenStream. Read more

fn to_token_stream(&self) -> TokenStream[src]

Convert self directly into a TokenStream object. Read more

fn into_token_stream(self) -> TokenStream[src]

Convert self directly into a TokenStream object. Read more

impl TryInto<Ident> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<Ident, Self::Error>[src]

Performs the conversion.

impl TryInto<LitBool> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<LitBool, Self::Error>[src]

Performs the conversion.

impl TryInto<LitByteStr> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<LitByteStr, Self::Error>[src]

Performs the conversion.

impl TryInto<LitChar> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<LitChar, Self::Error>[src]

Performs the conversion.

impl TryInto<LitFloat> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<LitFloat, Self::Error>[src]

Performs the conversion.

impl TryInto<LitInt> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<LitInt, Self::Error>[src]

Performs the conversion.

impl TryInto<LitStr> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<LitStr, Self::Error>[src]

Performs the conversion.

impl TryInto<Option<Ident>> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<Option<Ident>, Self::Error>[src]

Performs the conversion.

impl TryInto<Option<LitBool>> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<Option<LitBool>, Self::Error>[src]

Performs the conversion.

impl TryInto<Option<LitByteStr>> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<Option<LitByteStr>, Self::Error>[src]

Performs the conversion.

impl TryInto<Option<LitChar>> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<Option<LitChar>, Self::Error>[src]

Performs the conversion.

impl TryInto<Option<LitFloat>> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<Option<LitFloat>, Self::Error>[src]

Performs the conversion.

impl TryInto<Option<LitInt>> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<Option<LitInt>, Self::Error>[src]

Performs the conversion.

impl TryInto<Option<LitStr>> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<Option<LitStr>, Self::Error>[src]

Performs the conversion.

impl TryInto<Option<Path>> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<Option<Path>, Self::Error>[src]

Performs the conversion.

impl TryInto<Path> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<Path, Self::Error>[src]

Performs the conversion.

impl TryInto<String> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<String, Self::Error>[src]

Performs the conversion.

impl TryInto<Vec<u8, Global>> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<Vec<u8>, Self::Error>[src]

Performs the conversion.

impl TryInto<bool> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<bool, Self::Error>[src]

Performs the conversion.

impl TryInto<char> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<char, Self::Error>[src]

Performs the conversion.

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> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Spanned for T where
    T: Spanned + ?Sized
[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]

type Owned = T

The resulting type after obtaining ownership.

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]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.