Rust

[Key]: attribute, index and collection keys.

Contents

use utopia_database::validator::key::Key;
Rust
pub struct Key

A key: 1 to max_length characters among a-z, A-Z, 0-9, ., - and _, not starting with ., - or _. With allow_internal, the internal keys $id, $createdAt and $updatedAt are keys too.

Rust
use utopia_database::validator::key::Key;
use utopia_database::value::string;

let key = Key::default();
assert!(key.is_valid(&string("movie_1")));
assert!(!key.is_valid(&string("_movie")));
assert!(!key.is_valid(&string("$id")));
assert!(Key::new(true, 36).is_valid(&string("$id")));
Also implements Default.