Expand description
Entry points for the validation the Evenframe derive generates. Each
validator family is bound by a trait, so a validator on a field type it
cannot apply to is a compile error rather than a silent pass. A newtype
meets each bound its inner type meets.
Structs§
Traits§
- BigInt
Value - An integer a
BigIntValidatorcompares. - Clamp
Target - A number, bigint or decimal
clamppulls into range, its bounds written as decimals. - Decimal
Value - A decimal a
BigDecimalValidatorcompares exactly, through its text. - Duration
Value - A duration a
DurationValidatorcompares, in nanoseconds. - Instant
Value - A value a
DateValidatorcompares, as the instant JavaScript’sDatewould hold. - Item
Count - A collection an
ArrayValidatorcounts. - Newtype
- A struct serde writes as its one field’s value. The derive implements it, so a validator on a field holding the newtype checks the value inside.
- Number
Value - A number a
NumberValidatorapplies to, compared as JavaScript does: as an f64. - Round
Target - A number
roundrewrites, as JavaScript’sMath.roundrounds it. - Sort
Target - A list
sortorders. - String
Target - Text a string morph rewrites.
- String
Value - Text a
StringValidatorchecks. - Unique
Target - A list
uniquedrops repeats from.
Functions§
- check_
big_ int - check_
date - check_
decimal - check_
duration - check_
items - check_
number - check_
string - Applies a string check.
- clamp_
number - Pulls the value into
min..=max. - decimal_
places - The digits after the point in
number’s shortest decimal form, which is how Rust and SurrealDB both write a float, never with an exponent. - is_
multiple_ of - Effect’s
multipleOf: the remainder after scaling both operands to integers by the larger number of decimal places is zero. - morph_
string - Applies a string morph in place.
- round_
number - Rounds the value to
placesdecimal places. - sort_
items - Orders the elements ascending.
- unique_
items - Drops every element equal to an earlier one, keeping the first.