Enum amplify_syn::ArgReq [−][src]
pub enum ArgReq { Required { default: Option<ArgValue>, class: ValueClass, }, Optional(ValueClass), Prohibited, }
Requirements for attribute or named argument value presence
Variants
Argument must hold a value with the provided class
Show fields
Fields of Required
Optional(ValueClass)
Argument or an attribute may or may not hold a value
Argument or an attribute must not hold a value
Implementations
impl ArgReq
[src]
impl ArgReq
[src]pub fn with_default(default: impl Into<ArgValue>) -> ArgReq
[src]
Constructs argument requirements object with default value
pub fn required(class: ValueClass) -> ArgReq
[src]
Construct ArgReq::Required
variant with no default value
pub fn value_class(&self) -> Option<ValueClass>
[src]
Returns value class requirements, if any
pub fn default_value(&self) -> ArgValue
[src]
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).
pub fn is_required(&self) -> bool
[src]
Determines whether argument is required to have a value
pub fn check(
&self,
value: &mut ArgValue,
attr: impl ToString,
arg: impl ToString
) -> Result<(), Error>
[src]
&self,
value: &mut ArgValue,
attr: impl ToString,
arg: impl ToString
) -> Result<(), Error>
Checks the argument against current requirements, generating Error
if the requirements are not met.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ArgReq
impl RefUnwindSafe for ArgReq
impl UnwindSafe for ArgReq
impl UnwindSafe for ArgReq