pub struct EmbeddingRefBlock {
pub vector_id: Vec<u8>,
pub source_hash: Vec<u8>,
pub model: String,
}Expand description
EMBEDDING_REF block — vector embedding reference.
Points to a pre-computed vector embedding stored externally (e.g. in
a vector database). The source_hash provides a content-addressable
link back to the original content that was embedded, using BLAKE3.
Field layout within body:
┌──────────┬───────────┬─────────────┬─────────────────────────┐
│ Field ID │ Wire Type │ Name │ Description │
├──────────┼───────────┼─────────────┼─────────────────────────┤
│ 1 │ Bytes │ vector_id │ Vector store identifier │
│ 2 │ Bytes │ source_hash │ BLAKE3 content hash │
│ 3 │ Bytes │ model │ Embedding model name │
└──────────┴───────────┴─────────────┴─────────────────────────┘Fields§
§vector_id: Vec<u8>Opaque identifier for the vector in the external store.
source_hash: Vec<u8>BLAKE3 hash of the source content that was embedded.
model: StringName of the embedding model (e.g. “text-embedding-3-small”).
Implementations§
Source§impl EmbeddingRefBlock
impl EmbeddingRefBlock
Sourcepub fn encode_body(&self) -> Vec<u8> ⓘ
pub fn encode_body(&self) -> Vec<u8> ⓘ
Serialize this block’s fields into a TLV-encoded body.
Sourcepub fn decode_body(buf: &[u8]) -> Result<Self, TypeError>
pub fn decode_body(buf: &[u8]) -> Result<Self, TypeError>
Deserialize an EMBEDDING_REF block from a TLV-encoded body.
Trait Implementations§
Source§impl Clone for EmbeddingRefBlock
impl Clone for EmbeddingRefBlock
Source§fn clone(&self) -> EmbeddingRefBlock
fn clone(&self) -> EmbeddingRefBlock
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmbeddingRefBlock
impl Debug for EmbeddingRefBlock
Source§impl PartialEq for EmbeddingRefBlock
impl PartialEq for EmbeddingRefBlock
impl Eq for EmbeddingRefBlock
impl StructuralPartialEq for EmbeddingRefBlock
Auto Trait Implementations§
impl Freeze for EmbeddingRefBlock
impl RefUnwindSafe for EmbeddingRefBlock
impl Send for EmbeddingRefBlock
impl Sync for EmbeddingRefBlock
impl Unpin for EmbeddingRefBlock
impl UnsafeUnpin for EmbeddingRefBlock
impl UnwindSafe for EmbeddingRefBlock
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
Mutably borrows from an owned value. Read more