pub struct Commit {
pub schema_version: u32,
pub parents: Vec<CommitHash>,
pub timestamp: u64,
pub author: String,
pub message: String,
pub state_root: StateRoot,
pub manifests: Vec<Hash>,
pub signature: Option<CommitSignature>,
pub payload_hash: Option<Hash>,
}Fields§
§schema_version: u32§parents: Vec<CommitHash>§timestamp: u64§message: String§state_root: StateRoot§manifests: Vec<Hash>§signature: Option<CommitSignature>§payload_hash: Option<Hash>hash_typed(COMMIT_PAYLOAD_TAG, &to_cbor(&unsigned)) where unsigned
is this commit with signature and payload_hash both set to None.
Present only on signed commits; verifiers MUST re-derive and compare.
skip_serializing_if keeps unsigned commits byte-identical to commits
produced by code that predates this field: None is encoded by
omitting the key rather than by an explicit null. Without this,
adding the field would change every existing unsigned commit’s hash.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Commit
impl<'de> Deserialize<'de> for Commit
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 Commit
impl StructuralPartialEq for Commit
Auto Trait Implementations§
impl Freeze for Commit
impl RefUnwindSafe for Commit
impl Send for Commit
impl Sync for Commit
impl Unpin for Commit
impl UnsafeUnpin for Commit
impl UnwindSafe for Commit
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