Enum amplify_syn::ArgValueReq[][src]

pub enum ArgValueReq {
    Required {
        default: Option<ArgValue>,
        class: ValueClass,
    },
    Optional(ValueClass),
    Prohibited,
}
Expand description

Requirements for attribute or named argument value presence

Variants

Required

Argument must hold a value with the provided class

Fields of Required

default: Option<ArgValue>

Default value

class: ValueClass

Type of the value literal

Optional

Argument or an attribute may or may not hold a value

Tuple Fields of Optional

0: ValueClass
Prohibited

Argument or an attribute must not hold a value

Implementations

Constructs argument requirements object with default value

Construct ArgValueReq::Required variant with no default value

Returns value class requirements, if any

Returns default argument value. If not default is provided within the requirement, returns ArgValue::None (since this is de facto default value for any argument).

Determines whether argument is required to have a value

Checks the argument against current requirements, generating Error if the requirements are not met.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

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.