pub struct WorkspaceId(/* private fields */);Expand description
32-byte stable identity for a logical workspace, byte-identical to
sqry_core::workspace::WorkspaceId.
Defined here in the leaf protocol crate so the daemon wire types
(DaemonHello.logical_workspace, daemon/load.logical_workspace,
daemon/workspaceStatus.workspace_id) can carry the identity without
the protocol crate taking a sqry-core dependency. The sqry-daemon
binary owns the From/Into bridge against the canonical
sqry_core::workspace::WorkspaceId type — both use the same 32-byte
representation, so the bridge is a zero-cost newtype unwrap.
STEP_6 (workspace-aware-cross-repo DAG) introduced this type. Older
daemon clients that send DaemonHello without logical_workspace
continue to work because the field is #[serde(default)] — they
reproduce today’s per-source-root semantics, with workspace_id = None on the matching crate::WorkspaceState entries.
Implementations§
Source§impl WorkspaceId
impl WorkspaceId
Sourcepub const fn from_bytes(bytes: [u8; 32]) -> Self
pub const fn from_bytes(bytes: [u8; 32]) -> Self
Construct from raw 32 bytes. Callers in sqry-daemon use this
to bridge from sqry_core::workspace::WorkspaceId::as_bytes().
Sourcepub const fn as_bytes(&self) -> &[u8; 32]
pub const fn as_bytes(&self) -> &[u8; 32]
Borrow the 32-byte digest. Callers cross the bridge by feeding
these bytes back into sqry_core::workspace::WorkspaceId.
Sourcepub fn as_short_hex(&self) -> String
pub fn as_short_hex(&self) -> String
First 16 hex characters. Suitable for log lines / short identifiers; not sufficient for cross-process identity.
Sourcepub fn as_full_hex(&self) -> String
pub fn as_full_hex(&self) -> String
Full 64-character hex digest. Use this for any identity comparison.
Trait Implementations§
Source§impl Clone for WorkspaceId
impl Clone for WorkspaceId
Source§fn clone(&self) -> WorkspaceId
fn clone(&self) -> WorkspaceId
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more