Enum amplify_syn::ListReq [−][src]
pub enum ListReq<T> where
T: Clone, {
Single {
whitelist: Option<Vec<T>>,
default: Option<T>,
},
Many {
whitelist: Option<Vec<T>>,
required: bool,
max_no: Option<u8>,
},
Predefined {
whitelist: Option<Vec<T>>,
default: Vec<T>,
},
Deny,
}
Expand description
Requirements for list elements. For instance, used in AttrReq
for
providing crate::ParametrizedAttr
fields requirements.
Variants
Only a single value allowed and it must be present
Fields of Single
whitelist: Option<Vec<T>>
Restricts set of possible values to the given whitelist
NB: If whitelist does not contain values from the default
field,
they are still accepted as valid, i.e. “automatically whitelisted”
default: Option<T>
Default value assigned as a signe list item if no values are provided
NB: If whitelist does not contain values from the default
field,
they are still accepted as valid, i.e. “automatically whitelisted”
Any number of any elements may be present
Fields of Many
Any number of any elements may not be present; if none of the elements is present the list will use default vec of the values
Fields of Predefined
whitelist: Option<Vec<T>>
Restricts set of possible values to the given whitelist.
NB: If whitelist does not contain values from the default
field,
they are still accepted as valid, i.e. “automatically whitelisted”
default: Vec<T>
Default set of values for the list used if no values are provided
NB: If whitelist does not contain values from the default
field,
they are still accepted as valid, i.e. “automatically whitelisted”
Element must not be present
Implementations
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for ListReq<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for ListReq<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more