Struct fog_pack::validator::StreamLockboxValidator[][src]

pub struct StreamLockboxValidator {
    pub comment: String,
    pub max_len: u32,
    pub min_len: u32,
    pub size: bool,
}

Validator for a StreamLockbox. This validator will only pass a StreamLockbox 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: String

An optional comment explaining the validator.

max_len: u32

Set the maximum allowed number of bytes.

min_len: u32

Set the minimum allowed number of bytes.

size: bool

If true, queries against matching spots may set the min_len and max_len values to non-defaults.

Implementations

impl StreamLockboxValidator[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 StreamLockboxValidator[src]

impl Debug for StreamLockboxValidator[src]

impl Default for StreamLockboxValidator[src]

impl<'de> Deserialize<'de> for StreamLockboxValidator where
    StreamLockboxValidator: Default
[src]

impl PartialEq<StreamLockboxValidator> for StreamLockboxValidator[src]

impl Serialize for StreamLockboxValidator[src]

impl StructuralPartialEq for StreamLockboxValidator[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,