pub struct EnvelopeBlock {
pub block_type: BlockType,
pub jis_level: u8,
pub content_hash: ContentHash,
pub data: Vec<u8>,
pub signature: Option<Vec<u8>>,
}Expand description
A single block within an envelope
Fields§
§block_type: BlockType§jis_level: u8§content_hash: ContentHash§data: Vec<u8>§signature: Option<Vec<u8>>Implementations§
Source§impl EnvelopeBlock
impl EnvelopeBlock
pub fn new_embedding(data: Vec<u8>) -> Self
pub fn new_content(data: Vec<u8>, jis_level: u8) -> Self
pub fn new_system_prompt(data: Vec<u8>, jis_level: u8) -> Self
Sourcepub fn verify_integrity(&self) -> bool
pub fn verify_integrity(&self) -> bool
Verify the content hash matches the data
Trait Implementations§
Source§impl Clone for EnvelopeBlock
impl Clone for EnvelopeBlock
Source§fn clone(&self) -> EnvelopeBlock
fn clone(&self) -> EnvelopeBlock
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 EnvelopeBlock
impl Debug for EnvelopeBlock
Source§impl<'de> Deserialize<'de> for EnvelopeBlock
impl<'de> Deserialize<'de> for EnvelopeBlock
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 EnvelopeBlock
impl RefUnwindSafe for EnvelopeBlock
impl Send for EnvelopeBlock
impl Sync for EnvelopeBlock
impl Unpin for EnvelopeBlock
impl UnsafeUnpin for EnvelopeBlock
impl UnwindSafe for EnvelopeBlock
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