pub struct CommitV0 {
pub id: Option<ObjectId>,
pub key: Option<SymKey>,
pub header: Option<CommitHeader>,
pub body: OnceCell<CommitBody>,
pub blocks: Vec<BlockId>,
pub content: CommitContent,
pub sig: Sig,
}
Expand description
Commit object
Signed by member key authorized to publish this commit type
Fields§
§id: Option<ObjectId>
ID of containing Object
key: Option<SymKey>
Key of containing Object
header: Option<CommitHeader>
optional Commit Header
body: OnceCell<CommitBody>
optional Commit Body
blocks: Vec<BlockId>
optional List of blocks, including the header and body ones. First one is the ObjectId of commit. Vec is ready to be sent in Event
content: CommitContent
Commit content
sig: Sig
Signature over the content (a CommitContent) by the author. an editor (UserId)
Implementations§
Source§impl CommitV0
impl CommitV0
Sourcepub fn new(
author_privkey: &PrivKey,
author_pubkey: &PubKey,
overlay: OverlayId,
branch: BranchId,
quorum: QuorumType,
deps: Vec<ObjectRef>,
ndeps: Vec<ObjectRef>,
acks: Vec<ObjectRef>,
nacks: Vec<ObjectRef>,
files: Vec<ObjectRef>,
nfiles: Vec<ObjectRef>,
metadata: Vec<u8>,
body: ObjectRef,
) -> Result<CommitV0, NgError>
pub fn new( author_privkey: &PrivKey, author_pubkey: &PubKey, overlay: OverlayId, branch: BranchId, quorum: QuorumType, deps: Vec<ObjectRef>, ndeps: Vec<ObjectRef>, acks: Vec<ObjectRef>, nacks: Vec<ObjectRef>, files: Vec<ObjectRef>, nfiles: Vec<ObjectRef>, metadata: Vec<u8>, body: ObjectRef, ) -> Result<CommitV0, NgError>
New commit
pub fn save( &mut self, block_size: usize, store: &Store, ) -> Result<ObjectRef, StorageError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CommitV0
impl<'de> Deserialize<'de> for CommitV0
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 CommitV0
impl StructuralPartialEq for CommitV0
Auto Trait Implementations§
impl !Freeze for CommitV0
impl RefUnwindSafe for CommitV0
impl Send for CommitV0
impl Sync for CommitV0
impl Unpin for CommitV0
impl UnwindSafe for CommitV0
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