validate_key (storage/key_types.rs)

astrid · crates/astrid-audit/src/storage/key_types.rs · rust · Apache-2.0
database, tag:embed-classified

Defines and validates typed keys for durable audit storage.

// Source: https://github.com/astrid-runtime/astrid | License: Apache-2.0 | Copyright 2025 Joshua J. Bouw and Unicity Labs
// Provided via justclaw.it.com; keep this notice with the code.
//! Domain types for durable audit-storage keys and sequence values.
//!
//! Audit projections use several string-shaped keys in different namespaces.
//! Keeping those keys as distinct types makes it harder to pass a session
//! index key to a chain projection (or a segment key to a sequence
//! projection), while the transparent serde representation preserves the
//! existing on-disk append-intent format.

use serde::{Deserialize, Deserializer, Serialize, de::Error as _};

/// A monotonically increasing session-entry sequence.
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
pub(super) stru

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key