Struct fog_pack::validator::IdentityValidator[][src]

pub struct IdentityValidator {
    pub comment: String,
    pub in_list: Vec<Identity>,
    pub nin_list: Vec<Identity>,
    pub query: bool,
}

Validator for a cryptographic Identity.

This validator will only pass an Identity value. Validation passes if:

  • If the in list is not empty, the Identity must be among the ones in the list.
  • The Identity must not be among the ones in the nin list.

Defaults

Fields that aren’t specified for the validator use their defaults instead. The defaults for each field are:

  • comment: “”
  • in_list: empty
  • nin_list: empty
  • query: false

Fields

comment: String

An optional comment explaining the validator.

in_list: Vec<Identity>

A vector of specific allowed values, stored under the in field. If empty, this vector is not checked against.

nin_list: Vec<Identity>

A vector of specific unallowed values, stored under the nin field.

query: bool

If true, queries against matching spots may have values in the in or nin lists.

Implementations

impl IdentityValidator[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 in_add(self, add: impl Into<Identity>) -> Self[src]

Add a value to the in list.

pub fn nin_add(self, add: impl Into<Identity>) -> Self[src]

Add a value to the nin list.

pub fn query(self, query: bool) -> Self[src]

Set whether or not queries can use the in and nin lists.

pub fn build(self) -> Validator[src]

Build this into a Validator enum.

Trait Implementations

impl Clone for IdentityValidator[src]

impl Debug for IdentityValidator[src]

impl Default for IdentityValidator[src]

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

impl PartialEq<IdentityValidator> for IdentityValidator[src]

impl Serialize for IdentityValidator[src]

impl StructuralPartialEq for IdentityValidator[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>,