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.
Trait Implementations§
impl Copy for SchemaId
impl Eq for SchemaId
impl StructuralPartialEq for SchemaId
Auto Trait Implementations§
impl Freeze for SchemaId
impl RefUnwindSafe for SchemaId
impl Send for SchemaId
impl Sync for SchemaId
impl Unpin for SchemaId
impl UnsafeUnpin for SchemaId
impl UnwindSafe for SchemaId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.