Enum amplify_syn::Error[][src]

pub enum Error {
Show 20 variants Parse(Error), NamesDontMatch(String, String), 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),
}
Expand description

Errors representing inconsistency in proc macro attribute structure

Variants

Parse

Parse error from a syn crate

Tuple Fields of Parse

0: Error
NamesDontMatch

Names of two merged attributes must match each other

Tuple Fields of NamesDontMatch

0: String1: String
MultipleSingularValues

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

Tuple Fields of MultipleSingularValues

0: String
MultipleLiteralValues

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

Tuple Fields of MultipleLiteralValues

0: String
UnsupportedLiteral

Attribute contains unsupported literal argument

Tuple Fields of UnsupportedLiteral

0: String
SingularAttrRequired

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

Tuple Fields of SingularAttrRequired

0: String
ParametrizedAttrRequired

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

Tuple Fields of ParametrizedAttrRequired

0: String
AttributeUnknownArgument

Attribute has an unknown argument

Fields of AttributeUnknownArgument

attr: String

Attribute name

arg: String

Argument name

ArgTypeProhibited

Attribute is not allowed to have argument of type arg

Fields of ArgTypeProhibited

attr: String

Attribute name

arg: String

Argument name

ArgNumberExceedsMax

Number of arg arguments in attribute attr exceeds maximum

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

Fields of ArgMustNotHaveValue

attr: String

Attribute name

arg: String

Argument name

ArgRequired

Attribute must has an arg argument

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)])

Fields of ArgNameMustBeUnique

attr: String

Attribute name

arg: String

Argument name

ArgValueRequired

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

Fields of ArgValueRequired

attr: String

Attribute name

arg: String

Argument name

ArgValueTypeMismatch

Attribute value type mismatch

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

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

Tuple Fields of ParametrizedAttrHasNoValue

0: String
NestedListsNotSupported
👎 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

Tuple Fields of NestedListsNotSupported

0: String
👎 Deprecated since 1.1.0:

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

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

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

recently added

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.