pub enum Validator {
Show 23 variants
Null,
Bool(Box<BoolValidator>),
Int(Box<IntValidator>),
F32(Box<F32Validator>),
F64(Box<F64Validator>),
Bin(Box<BinValidator>),
Str(Box<StrValidator>),
Array(Box<ArrayValidator>),
Map(Box<MapValidator>),
Time(Box<TimeValidator>),
Hash(Box<HashValidator>),
Identity(Box<IdentityValidator>),
StreamId(Box<StreamIdValidator>),
LockId(Box<LockIdValidator>),
BareIdKey,
DataLockbox(Box<DataLockboxValidator>),
IdentityLockbox(Box<IdentityLockboxValidator>),
StreamLockbox(Box<StreamLockboxValidator>),
LockLockbox(Box<LockLockboxValidator>),
Ref(String),
Multi(MultiValidator),
Enum(EnumValidator),
Any,
}Expand description
A fog-pack Validator, for verifying the form of a fog-pack Document or Entry.
Validators can be used to verify a fog-pack Document or Entry. Schemas use them for verification, and they are also used by Queries to find matching Entries.
This enum contains all possible validators. See the module-level documentation for details.
Variants§
Null
Validator::Null - for the null type.
Bool(Box<BoolValidator>)
BoolValidator - for booleans.
Int(Box<IntValidator>)
IntValidator - for Integer and other integer values.
F32(Box<F32Validator>)
F32Validator - for f32 values.
F64(Box<F64Validator>)
F64Validator - for f64 values.
Bin(Box<BinValidator>)
BinValidator - for byte sequences.
Str(Box<StrValidator>)
StrValidator - for UTF-8 strings.
Array(Box<ArrayValidator>)
ArrayValidator - for sequences, like Vec, arrays, or tuples.
Map(Box<MapValidator>)
MapValidator - for maps, like struct, BTreeMap, and HashMap
Time(Box<TimeValidator>)
TimeValidator - for Timestamp
Hash(Box<HashValidator>)
HashValidator - for Hash
Identity(Box<IdentityValidator>)
IdentityValidator - for Identity
StreamId(Box<StreamIdValidator>)
StreamIdValidator - for StreamId
LockId(Box<LockIdValidator>)
LockIdValidator - for LockId
BareIdKey
DataLockbox(Box<DataLockboxValidator>)
IdentityLockbox(Box<IdentityLockboxValidator>)
StreamLockbox(Box<StreamLockboxValidator>)
LockLockbox(Box<LockLockboxValidator>)
Ref(String)
Validator::Ref - a reference to a validator stored in a
schema’s map of types. Uses a name to look up the validator.
Multi(MultiValidator)
MultiValidator - Will attempt a sequence of validators, passing if any one of them pass.
Enum(EnumValidator)
EnumValidator - Acts as a validator for serialized Rust enums.
This can also be implemented through MapValidator, but this
validator is generally easier to use correctly in such cases.
Any
Validator::Any - accepts any fog-pack value without examining it.