Skip to main content

Module types

Module types 

Source
Expand description

Constrained newtypes that validate on construction and on deserialize.

Structs§

BoundedFloat
Finite f64 constrained by B.
BoundedI64
Signed 64-bit integer whose value is in MIN..=MAX.
ConstrainedString
UTF-8 string whose character length is in MIN..=MAX.
ConstrainedVec
A Vec<T> whose length is in MIN..=MAX.
Decimal
Decimal number with at most MAX_DIGITS significant digits and at most DECIMAL_PLACES digits after the decimal point.
Email
Email address validated by the pragmatic rules::email check.
HttpUrl
An absolute http or https URL.
IpAddress
An IPv4 or IPv6 address.
Ipv4Address
An IPv4 address.
Ipv6Address
An IPv6 address.
NegativeInt
Strictly negative i64 (value < 0).
NonNegative
Non-negative floats (>= 0.0).
NonNegativeInt
Non-negative i64 (value >= 0).
Positive
Strictly positive floats (> 0.0).
PositiveInt
Strictly positive i64 (value > 0).
SecretString
Opaque string that redacts its contents in Debug, Display, and Serialize.
UnitInterval
Closed unit interval 0.0..=1.0.
Url
An absolute URL of any scheme.
Uuid
An RFC 4122 UUID of any version.

Traits§

FloatBounds
Inclusive/exclusive bounds for BoundedFloat.

Type Aliases§

UnboundedDecimal
Decimal constrained only by rust_decimal’s maximum scale of 28.