Struct fog_pack::validator::IdentityLockboxValidator [−][src]
Validator for a IdentityLockbox.
This validator will only pass a
IdentityLockbox
value. Validation passes if:
- The number of bytes in the lockbox is less than or equal to
max_len - The number of bytes in the lockbox is greater than or equal to
min_len
Defaults
Fields that aren’t specified for the validator use their defaults instead. The defaults for each field are:
- comment: “”
- max_len: u32::MAX
- min_len: 0
- size: false
Query Checking
Queries for lockboxes are only allowed to use non default values for max_len and
min_len if size is set in the schema’s validator.
Fields
comment: StringAn optional comment explaining the validator.
max_len: u32Set the maximum allowed number of bytes.
min_len: u32Set the minimum allowed number of bytes.
size: boolIf true, queries against matching spots may set the min_len and max_len values
to non-defaults.
Implementations
impl IdentityLockboxValidator[src]
pub fn new() -> Self[src]
Make a new validator with the default configuration.
pub fn comment(self, comment: impl Into<String>) -> Self[src]
Set a comment for the validator.
pub fn max_len(self, max_len: u32) -> Self[src]
Set the maximum number of allowed bytes.
pub fn min_len(self, min_len: u32) -> Self[src]
Set the minimum number of allowed bytes.
pub fn size(self, size: bool) -> Self[src]
Set whether or not queries can use the max_len and min_len values.
pub fn build(self) -> Validator[src]
Build this into a Validator enum.
Trait Implementations
impl Clone for IdentityLockboxValidator[src]
fn clone(&self) -> IdentityLockboxValidator[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for IdentityLockboxValidator[src]
impl Default for IdentityLockboxValidator[src]
impl<'de> Deserialize<'de> for IdentityLockboxValidator where
IdentityLockboxValidator: Default, [src]
IdentityLockboxValidator: Default,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
impl PartialEq<IdentityLockboxValidator> for IdentityLockboxValidator[src]
fn eq(&self, other: &IdentityLockboxValidator) -> bool[src]
fn ne(&self, other: &IdentityLockboxValidator) -> bool[src]
impl Serialize for IdentityLockboxValidator[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer, [src]
__S: Serializer,
impl StructuralPartialEq for IdentityLockboxValidator[src]
Auto Trait Implementations
impl RefUnwindSafe for IdentityLockboxValidator
impl Send for IdentityLockboxValidator
impl Sync for IdentityLockboxValidator
impl Unpin for IdentityLockboxValidator
impl UnwindSafe for IdentityLockboxValidator
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,