Enum amplify_syn::Error[][src]

pub enum Error {
Show variants Parse(Error), NamesDontMatch(StringString), MultipleSingularValues(String), MultipleLiteralValues(String), UnsupportedLiteral(String), SingularAttrRequired(String), ParametrizedAttrRequired(String), AttributeUnknownArgument { attr: String, arg: String, }, ArgTypeProhibited { attr: String, arg: String, }, ArgNumberExceedsMax { attr: String, type_name: String, no: usize, max_no: u8, }, ArgMustNotHaveValue { attr: String, arg: String, }, ArgRequired { attr: String, arg: String, }, ArgNameMustBeIdent, ArgNameMustBeUnique { attr: String, arg: String, }, ArgValueRequired { attr: String, arg: String, }, ArgValueTypeMismatch { attr: String, arg: String, }, ArgValueMustBeLiteral, ArgValueMustBeType, ParametrizedAttrHasNoValue(String), NestedListsNotSupported(String),
}

Errors representing inconsistency in proc macro attribute structure

Variants

Parse(Error)

Parse error from a syn crate

NamesDontMatch(StringString)

Names of two merged attributes must match each other

MultipleSingularValues(String)

Singular argument (of form #[attr = ...]) has multiple occurrences each assigned value. This is meaningless.

MultipleLiteralValues(String)

Multiple literal non-string values are given for a parametrized attribute in form of #[attr(literal1, literal2)]. This is meaningless.

UnsupportedLiteral(String)

Attribute contains unsupported literal argument

SingularAttrRequired(String)

Attribute must be in a singular form (#[attr] or #[attr = ...])

ParametrizedAttrRequired(String)

Attribute must be in a parametrized form (#[attr(...)])

AttributeUnknownArgument

Attribute has an unknown argument

Show fields

Fields of AttributeUnknownArgument

attr: String

Attribute name

arg: String

Argument name

ArgTypeProhibited

Attribute is not allowed to have argument of type arg

Show fields

Fields of ArgTypeProhibited

attr: String

Attribute name

arg: String

Argument name

ArgNumberExceedsMax

Number of arg arguments in attribute attr exceeds maximum

Show fields

Fields of ArgNumberExceedsMax

attr: String

Attribute name

type_name: String

Argument type name

no: usize

Number of arguments

max_no: u8

Maximum allowed number of arguments

ArgMustNotHaveValue

Attribute argument arg must not have a value

Show fields

Fields of ArgMustNotHaveValue

attr: String

Attribute name

arg: String

Argument name

ArgRequired

Attribute must has an arg argument

Show fields

Fields of ArgRequired

attr: String

Attribute name

arg: String

Argument name

ArgNameMustBeIdent

Attribute or attribute argument name (in form of #[attr(arg = ...)]) must be an identifier (like arg) and not a path (like std::io)

ArgNameMustBeUnique

The same argument name is used multiple times within parametrized attribute (like in #[attr(name1 = value1, name1 = value2)])

Show fields

Fields of ArgNameMustBeUnique

attr: String

Attribute name

arg: String

Argument name

ArgValueRequired

Attribute or attribute argument must has a value: #[attr(arg = value)]

Show fields

Fields of ArgValueRequired

attr: String

Attribute name

arg: String

Argument name

ArgValueTypeMismatch

Attribute value type mismatch

Show fields

Fields of ArgValueTypeMismatch

attr: String

Attribute name

arg: String

Argument name

ArgValueMustBeLiteral

Parametrized attribute argument must have a literal value (string, integer etc): #[attr(arg = "value")] or #[arg = 4]

ArgValueMustBeType

Parametrized attribute argument must be a valid type name: #[attr(arg = u8)] or #[arg = String]

ParametrizedAttrHasNoValue(String)

Parametrized attribute (in form of #[attr(...)]) does not have a single value

NestedListsNotSupported(String)
👎 Deprecated since 1.1.0:

This error variant is not used anymore after the introduction of custom attribute parser

Lists nested within attribute arguments, like #[attr(arg(...))] are not supported

Trait Implementations

impl Clone for Error[src]

impl Debug for Error[src]

impl Display for Error[src]

impl Error for Error[src]

impl From<Error> for Error[src]

impl From<Infallible> for Error[src]

Auto Trait Implementations

impl RefUnwindSafe for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl UnwindSafe for Error

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

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.