pub enum ListReq<T> {
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
Fields
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 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”
Only a single value allowed and it must be present
Fields
Restricts set of possible values to the given whitelist
Require that at least one value is present
Restricts the maximum number of items
Any number of any elements may be present
Fields
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 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”
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
Element must not be present
Convenience constructor for list requiring presence of an optional
single element.
Convenience constructor for list requiring presence of a single element
from a list of possible values.
Convenience constructor for list requiring presence of multiple elements
from a list of possible values.
Checks the value against the list requirements, generating Error
if
the requirements are not met.
Performs copy-assignment from
source
.
Read more
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more
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.