Enum amplify_syn::ArgValue[][src]

pub enum ArgValue {
    Literal(Lit),
    Type(Type),
    None,
}

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]

impl Debug for ArgValue[src]

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

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

impl From<Ident> for ArgValue[src]

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

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

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

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

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

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

impl From<Path> for ArgValue[src]

impl From<String> for ArgValue[src]

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

impl From<char> for ArgValue[src]

impl From<f64> for ArgValue[src]

impl From<isize> for ArgValue[src]

impl From<usize> for ArgValue[src]

impl Parse for ArgValue[src]

impl ToTokens for ArgValue[src]

impl TryInto<Ident> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryInto<LitBool> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryInto<LitByteStr> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryInto<LitChar> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryInto<LitFloat> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryInto<LitInt> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryInto<LitStr> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

impl TryInto<Path> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryInto<String> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

impl TryInto<bool> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryInto<char> for ArgValue[src]

type Error = Error

The type returned in the event of a conversion error.

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]

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.