Skip to content

sandbox_id

Structs

  • SandboxId - A validated identifier used to refer to a sandbox execution.
  • SandboxIdParseError - Error returned when text is not a valid sandbox identifier.

firma_runtime_state::sandbox_id::SandboxId

Section titled “firma_runtime_state::sandbox_id::SandboxId”

Struct

A validated identifier used to refer to a sandbox execution.

A SandboxId establishes that an identifier has the canonical sandbox ID representation. It does not prove that a corresponding managed execution exists or that the value came from firma run.

See the sandbox identity boundary contract for the architectural lifecycle, trust model, and protocol-specific binding rules.

The identifier serves three related architectural roles:

  • Runtime namespace. Runtime state uses validated IDs to name per-run resources. See [crate::runtime_paths::run_entry_from] and [crate::runtime_paths::capability_seed_path].
  • Correlation and attribution. Components can carry the ID in metadata and events to associate observations with the same execution.
  • Context key. Protocols can bind requests or server-side state to the ID to prevent context from being confused across executions. Each protocol owns and documents the binding it enforces.

The canonical representation is a sbx TypeID backed by an RFC 9562 UUID v7. The inner value is private. Text can be parsed through [std::str::FromStr] or [str::parse], which returns [SandboxIdParseError] for invalid input. The [serde::Serialize] and [serde::Deserialize] implementations preserve the same validated, canonical representation.

The type deliberately does not implement AsRef<std::path::Path>. Callers should use the runtime-path APIs linked above instead of treating unchecked text as a sandbox-scoped path component.

A sandbox ID is neither secret nor a bearer credential. Successful parsing proves only that text has the expected representation; it does not authenticate the source or authorize an operation. Any protocol carrying a sandbox ID must independently establish where the value came from and what, if any, binding it provides.

Tuple Struct: ()

Methods:

  • fn generate() -> Self - Generate a new time-ordered sbx sandbox identifier.

Traits: Copy, Eq

Trait Implementations:

  • Clone
    • fn clone(self: &Self) -> SandboxId
  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • Deserialize
    • fn deserialize<D>(deserializer: D) -> Result<Self, <D as >::Error>
  • Serialize
    • fn serialize<S>(self: &Self, serializer: S) -> Result<<S as >::Ok, <S as >::Error>
  • Display
    • fn fmt(self: &Self, formatter: & mut fmt::Formatter) -> fmt::Result
  • FromStr
    • fn from_str(value: &str) -> Result<Self, <Self as >::Err>
  • Hash
    • fn hash<__H>(self: &Self, state: & mut __H)
  • Ord
    • fn cmp(self: &Self, other: &SandboxId) -> $crate::cmp::Ordering
  • PartialOrd
    • fn partial_cmp(self: &Self, other: &SandboxId) -> $crate::option::Option<$crate::cmp::Ordering>
  • PartialEq
    • fn eq(self: &Self, other: &SandboxId) -> bool

firma_runtime_state::sandbox_id::SandboxIdParseError

Section titled “firma_runtime_state::sandbox_id::SandboxIdParseError”

Struct

Error returned when text is not a valid sandbox identifier.

Tuple Struct: ()

Trait Implementations:

  • Display
    • fn fmt(self: &Self, __formatter: & mut ::core::fmt::Formatter) -> ::core::fmt::Result
  • Error
    • fn source(self: &Self) -> ::core::option::Option<&dyn ::thiserror::__private18::Error>
  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result