Struct fog_pack::validator::DataLockboxValidator[][src]

pub struct DataLockboxValidator {
    pub comment: String,
    pub max_len: u32,
    pub min_len: u32,
    pub size: bool,
}
Expand description

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

Make a new validator with the default configuration.

Set a comment for the validator.

Set the maximum number of allowed bytes.

Set the minimum number of allowed bytes.

Set whether or not queries can use the max_len and min_len values.

Build this into a Validator enum.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.