pub struct SchemaId(/* private fields */);Expand description
Content schema hash that identifies the opaque payload’s type.
Implementations§
Source§impl SchemaId
impl SchemaId
Sourcepub const fn into_bytes(self) -> [u8; 32]
pub const fn into_bytes(self) -> [u8; 32]
Consume this schema id and return its hash bytes.
Sourcepub fn from_schema_bytes(schema_bytes: &[u8]) -> Self
pub fn from_schema_bytes(schema_bytes: &[u8]) -> Self
Derives the stable 32-byte schema id liminal uses for raw schema bytes.
This is THE derivation: the id a liminal-server channel advertises at
subscribe time is computed from the channel’s RAW schema bytes by this
function, and a publisher deriving an id from the same bytes converges
on it. It is FNV-1a 64 over the bytes, the 8-byte digest spread across
the 32-byte id and re-hashed after every full 8-byte block so the id is
not just the digest repeated. Byte-identical to the private
schema_id_from_bytes the server and the SDK transports carried before
it was made public here (pinned by tests/schema_id_derivation.rs
against a verbatim copy of that private path and a known answer), so
an embedder derives ids with liminal’s own bytes instead of a copy that
can drift silently.
Two byte sequences that parse to the same document but differ in bytes derive different ids; the derivation is over bytes, never a document.