pub struct Envelope {
pub id: String,
pub blocks: Vec<EnvelopeBlock>,
pub source: Option<String>,
pub created_at: DateTime<Utc>,
}Expand description
A TBZ-style envelope wrapping data with JIS level and TIBET provenance.
In a Cortex vector store, each document chunk is an Envelope:
- embedding at JIS 0 (searchable by anyone)
- content at JIS N (only readable with matching claim)
- TIBET hash for integrity verification
Fields§
§id: String§blocks: Vec<EnvelopeBlock>§source: Option<String>§created_at: DateTime<Utc>Implementations§
Source§impl Envelope
impl Envelope
pub fn new(id: impl Into<String>) -> Self
pub fn with_source(self, source: impl Into<String>) -> Self
pub fn add_block(&mut self, block: EnvelopeBlock)
Sourcepub fn embedding(&self) -> Option<&EnvelopeBlock>
pub fn embedding(&self) -> Option<&EnvelopeBlock>
Get the embedding block (JIS 0, always accessible)
Sourcepub fn content(&self, accessor_jis_level: u8) -> Option<&EnvelopeBlock>
pub fn content(&self, accessor_jis_level: u8) -> Option<&EnvelopeBlock>
Get content block only if JIS level is sufficient
Sourcepub fn max_jis_level(&self) -> u8
pub fn max_jis_level(&self) -> u8
Get the maximum JIS level required across all content blocks
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Envelope
impl<'de> Deserialize<'de> for Envelope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
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