sequence
Module[Sequence]: document sequence values ($sequence and id attributes).
Contents
use utopia_database::validator::sequence::Sequence;Rust
pub struct SequenceA sequence value: for the primary sequence ($sequence), a positive
integer (integer id type) or a UUIDv7 string (uuid7 id type); for
other id attributes, any string or integer. null is valid unless
primary.
Rust
use utopia_database::validator::sequence::Sequence;
use utopia_database::value::{Value, string};
let primary = Sequence::new("integer", true);
assert!(primary.is_valid(&Value::Int(1)));
assert!(!primary.is_valid(&Value::Int(0)));
assert!(Sequence::new("uuid7", true).is_valid(&string("0190d3f8-7e7c-7c8a-9a3e-123456789abc")));