Trait EntityIdType 

Source
pub trait EntityIdType:
    Copy
    + Clone
    + Eq
    + PartialEq
    + Hash
    + Debug
    + Display
    + FromStr
    + Serialize
    + DeserializeOwned
    + Send
    + Sync
    + 'static {
    const ENTITY_NAME: &'static str;

    // Required methods
    fn new(uuid: Uuid) -> Self;
    fn as_uuid(&self) -> Uuid;

    // Provided methods
    fn nil() -> Self { ... }
    fn now_v7() -> Self { ... }
    fn new_v4() -> Self { ... }
}
Expand description

Trait for type-safe entity IDs.

This trait provides compile-time safety by ensuring entity IDs cannot be accidentally mixed up. Each entity type has its own strongly-typed ID.

Required Associated Constants§

Source

const ENTITY_NAME: &'static str

The name of the entity type (e.g., “tenant”, “trajectory”).

Required Methods§

Source

fn new(uuid: Uuid) -> Self

Create a new ID from a UUID.

Source

fn as_uuid(&self) -> Uuid

Get the underlying UUID.

Provided Methods§

Source

fn nil() -> Self

Create a nil (all zeros) ID.

Source

fn now_v7() -> Self

Create a new timestamp-sortable UUIDv7 ID.

Source

fn new_v4() -> Self

Create a new random UUIDv4 ID.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl EntityIdType for ActionId

Source§

const ENTITY_NAME: &'static str = "action"

Source§

impl EntityIdType for ApiKeyId

Source§

const ENTITY_NAME: &'static str = "api_key"

Source§

impl EntityIdType for BeliefId

Source§

const ENTITY_NAME: &'static str = "belief"

Source§

impl EntityIdType for ConflictId

Source§

const ENTITY_NAME: &'static str = "conflict"

Source§

impl EntityIdType for DelegationId

Source§

const ENTITY_NAME: &'static str = "delegation"

Source§

impl EntityIdType for EdgeId

Source§

const ENTITY_NAME: &'static str = "edge"

Source§

impl EntityIdType for EventId

Source§

const ENTITY_NAME: &'static str = "event"

Source§

impl EntityIdType for FlowId

Source§

const ENTITY_NAME: &'static str = "flow"

Source§

impl EntityIdType for FlowStepId

Source§

const ENTITY_NAME: &'static str = "flow_step"

Source§

impl EntityIdType for GoalId

Source§

const ENTITY_NAME: &'static str = "goal"

Source§

impl EntityIdType for HandoffId

Source§

const ENTITY_NAME: &'static str = "handoff"

Source§

impl EntityIdType for InstanceId

Source§

const ENTITY_NAME: &'static str = "instance"

Source§

impl EntityIdType for LearningId

Source§

const ENTITY_NAME: &'static str = "learning"

Source§

impl EntityIdType for LockId

Source§

const ENTITY_NAME: &'static str = "lock"

Source§

impl EntityIdType for MessageId

Source§

const ENTITY_NAME: &'static str = "message"

Source§

impl EntityIdType for ObservationId

Source§

const ENTITY_NAME: &'static str = "observation"

Source§

impl EntityIdType for PackConfigId

Source§

const ENTITY_NAME: &'static str = "pack_config"

Source§

impl EntityIdType for PlanId

Source§

const ENTITY_NAME: &'static str = "plan"

Source§

impl EntityIdType for PrincipalId

Source§

const ENTITY_NAME: &'static str = "principal"

Source§

impl EntityIdType for SessionId

Source§

const ENTITY_NAME: &'static str = "session"

Source§

impl EntityIdType for SnapshotId

Source§

const ENTITY_NAME: &'static str = "snapshot"

Source§

impl EntityIdType for StepId

Source§

const ENTITY_NAME: &'static str = "step"

Source§

impl EntityIdType for SummarizationPolicyId

Source§

const ENTITY_NAME: &'static str = "summarization_policy"

Source§

impl EntityIdType for SummarizationRequestId

Source§

const ENTITY_NAME: &'static str = "summarization_request"

Source§

impl EntityIdType for TeamId

Source§

const ENTITY_NAME: &'static str = "team"

Source§

impl EntityIdType for ToolExecutionId

Source§

const ENTITY_NAME: &'static str = "tool_execution"

Source§

impl EntityIdType for WebhookId

Source§

const ENTITY_NAME: &'static str = "webhook"

Source§

impl EntityIdType for WorkingSetId

Source§

const ENTITY_NAME: &'static str = "working_set"

Source§

impl EntityIdType for AgentId

Source§

const ENTITY_NAME: &'static str = "agent"

Source§

impl EntityIdType for ArtifactId

Source§

const ENTITY_NAME: &'static str = "artifact"

Source§

impl EntityIdType for NoteId

Source§

const ENTITY_NAME: &'static str = "note"

Source§

impl EntityIdType for ScopeId

Source§

const ENTITY_NAME: &'static str = "scope"

Source§

impl EntityIdType for TenantId

Source§

const ENTITY_NAME: &'static str = "tenant"

Source§

impl EntityIdType for TrajectoryId

Source§

const ENTITY_NAME: &'static str = "trajectory"

Source§

impl EntityIdType for TurnId

Source§

const ENTITY_NAME: &'static str = "turn"