pub struct BlockV0 {
pub id: Option<BlockId>,
pub key: Option<SymKey>,
pub commit_header_key: Option<ObjectKey>,
pub content: BlockContent,
}
Expand description
Immutable block with encrypted content
ObjectContent
is chunked and stored as Block
s in a Merkle tree.
A Block is a Merkle tree node.
Fields§
§id: Option<BlockId>
Block ID
key: Option<SymKey>
Block Key
commit_header_key: Option<ObjectKey>
Header Key needed to open the CommitHeader. can be omitted if the Commit is shared without its ancestors, or if the block is not a root block of commit, or that commit is a root commit (first in branch)
content: BlockContent
Implementations§
Source§impl BlockV0
impl BlockV0
pub fn new( children: Vec<BlockId>, header_ref: Option<CommitHeaderRef>, content: Vec<u8>, key: Option<SymKey>, ) -> BlockV0
pub fn dummy() -> BlockV0
pub fn new_random_access( children: Vec<BlockId>, content: Vec<u8>, key: Option<SymKey>, ) -> BlockV0
Sourcepub fn compute_id(&self) -> BlockId
pub fn compute_id(&self) -> BlockId
Compute the ID
pub fn children(&self) -> &Vec<BlockId> ⓘ
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BlockV0
impl<'de> Deserialize<'de> for BlockV0
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 BlockV0
impl StructuralPartialEq for BlockV0
Auto Trait Implementations§
impl Freeze for BlockV0
impl RefUnwindSafe for BlockV0
impl Send for BlockV0
impl Sync for BlockV0
impl Unpin for BlockV0
impl UnwindSafe for BlockV0
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