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 [ParametrizedAttr
] fields requirements.
Variants
Only a single value allowed and it must be present
Show fields
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
Show fields
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
Show fields
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,
T: RefUnwindSafe,
impl<T> Send for ListReq<T> where
T: Send,
T: Send,
impl<T> Sync for ListReq<T> where
T: Sync,
T: Sync,
impl<T> Unpin for ListReq<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for ListReq<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more