pub enum Block {
V0(BlockV0),
}
Expand description
Immutable block with encrypted content
Variants§
Implementations§
Source§impl Block
impl Block
pub fn new( children: Vec<BlockId>, header_ref: Option<CommitHeaderRef>, content: Vec<u8>, key: Option<SymKey>, ) -> Block
pub fn dummy() -> Block
pub fn new_random_access( children: Vec<BlockId>, content: Vec<u8>, key: Option<SymKey>, ) -> Block
pub fn new_with_encrypted_content( content: Vec<u8>, key: Option<SymKey>, ) -> Block
pub fn size(&self) -> usize
Sourcepub fn compute_id(&self) -> BlockId
pub fn compute_id(&self) -> BlockId
Compute the ID
Sourcepub fn get_and_save_id(&mut self) -> BlockId
pub fn get_and_save_id(&mut self) -> BlockId
Get the already computed ID or computes it, saves it, and returns it
Sourcepub fn content(&self) -> &BlockContent
pub fn content(&self) -> &BlockContent
Get the content
Sourcepub fn encrypted_content(&self) -> &Vec<u8> ⓘ
pub fn encrypted_content(&self) -> &Vec<u8> ⓘ
Get the encrypted content
pub fn destroy_header(&mut self)
Sourcepub fn header_ref(&self) -> Option<CommitHeaderRef>
pub fn header_ref(&self) -> Option<CommitHeaderRef>
Get the header reference
pub fn read( &self, key: &SymKey, ) -> Result<(Vec<(BlockId, BlockKey)>, Vec<u8>), ObjectParseError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Block
impl<'de> Deserialize<'de> for Block
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
impl Eq for Block
impl StructuralPartialEq for Block
Auto Trait Implementations§
impl Freeze for Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnwindSafe for Block
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