Skip to main content

KernelIdSource

Trait KernelIdSource 

Source
pub trait KernelIdSource:
    Debug
    + Send
    + Sync {
    // Required methods
    fn next_run_id(&self) -> Result<RunId, KernelError>;
    fn next_turn_id(&self) -> Result<TurnId, KernelError>;
    fn next_message_id(&self) -> Result<MessageId, KernelError>;
    fn next_tool_call_id(&self) -> Result<ToolCallId, KernelError>;
    fn next_approval_id(&self) -> Result<ApprovalId, KernelError>;
    fn next_grant_id(&self) -> Result<GrantId, KernelError>;
    fn next_event_id(&self) -> Result<EventId, KernelError>;
    fn next_record_id(&self) -> Result<RecordId, KernelError>;
}
Expand description

Replaceable source of typed UUIDv7 runtime identities.

§Errors

Every method returns KernelErrorCode::IdExhausted when the configured source cannot provide the requested identity.

Required Methods§

Source

fn next_run_id(&self) -> Result<RunId, KernelError>

Produces a run ID.

§Errors

Returns an error when the ID source is exhausted.

Source

fn next_turn_id(&self) -> Result<TurnId, KernelError>

Produces a turn ID.

§Errors

Returns an error when the ID source is exhausted.

Source

fn next_message_id(&self) -> Result<MessageId, KernelError>

Produces a canonical message ID.

§Errors

Returns an error when the ID source is exhausted.

Source

fn next_tool_call_id(&self) -> Result<ToolCallId, KernelError>

Produces a canonical tool-call ID.

§Errors

Returns an error when the ID source is exhausted.

Source

fn next_approval_id(&self) -> Result<ApprovalId, KernelError>

Produces an approval ID.

§Errors

Returns an error when the ID source is exhausted.

Source

fn next_grant_id(&self) -> Result<GrantId, KernelError>

Produces a durable policy-grant ID.

§Errors

Returns an error when the ID source is exhausted.

Source

fn next_event_id(&self) -> Result<EventId, KernelError>

Produces an observable event ID.

§Errors

Returns an error when the ID source is exhausted.

Source

fn next_record_id(&self) -> Result<RecordId, KernelError>

Produces a durable record ID.

§Errors

Returns an error when the ID source is exhausted.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§