Enum amplify_syn::ValueReq [−][src]
pub enum ValueReq { Required, Default(ArgValue), Optional, Prohibited, }
Requirements for attribute or named argument value presence for a values
with known class. If the value class is not known, use ArgValueReq
instead.
Variants
Argument or an attribute must hold a value
Default(ArgValue)
Argument or an attribute must hold a value; if the value is not present it will be substituted for the default value provided as the inner field
Argument or an attribute may or may not hold a value
Argument or an attribute must not hold a value
Implementations
impl ValueReq
[src]
impl ValueReq
[src]pub fn is_required(&self) -> bool
[src]
Detects if the presence of the value is required
pub fn check<T>(
&self,
value: &mut T,
attr: impl ToString,
arg: impl ToString
) -> Result<(), Error> where
T: Clone + Into<ArgValue>,
ArgValue: TryInto<T>,
Error: From<<ArgValue as TryInto<T>>::Error>,
[src]
&self,
value: &mut T,
attr: impl ToString,
arg: impl ToString
) -> Result<(), Error> where
T: Clone + Into<ArgValue>,
ArgValue: TryInto<T>,
Error: From<<ArgValue as TryInto<T>>::Error>,
Checks the value against current requirements, generating Error
if
the requirements are not met.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ValueReq
impl RefUnwindSafe for ValueReq
impl UnwindSafe for ValueReq
impl UnwindSafe for ValueReq