pub struct Derivation {
pub op: Op,
pub source: RawContentId,
pub span: Span,
pub elided: RawContentId,
pub root: ContentId,
}Expand description
What was done, to which material, on whose authority.
This is the hashed body of a unit. Change the source, the span, the
operation or the root and you get a different ContentId — which is the
property the whole kernel rests on and is asserted directly by
tests/addressing.rs.
Fields§
§op: OpWhat was done to the material.
source: RawContentIdThe source byte string this derivation is over.
span: SpanWhich byte range of source.
elided: RawContentIdThe material that range covers.
Functionally redundant given source and span — and that is the
point. It is the claim being checked: re-derivation recomputes the
hash of the addressed bytes and compares it to this field. A check with
nothing recorded to compare against is not a check, and the earlier
revision shipped the word rederive without one.
root: ContentIdThe crate::RootEvent that caused this derivation.
Implementations§
Trait Implementations§
Source§impl Clone for Derivation
impl Clone for Derivation
Source§impl ContentAddressable for Derivation
impl ContentAddressable for Derivation
Source§fn canonical_form(&self) -> Result<Vec<u8>, ContentError>
fn canonical_form(&self) -> Result<Vec<u8>, ContentError>
Source§fn content_id(&self) -> Result<ContentId, ContentError>
fn content_id(&self) -> Result<ContentId, ContentError>
Source§fn verify(&self, expected: &ContentId) -> Result<bool, ContentError>
fn verify(&self, expected: &ContentId) -> Result<bool, ContentError>
expected id. Read moreSource§fn ensure_content_id(&self, expected: &ContentId) -> Result<(), ContentError>
fn ensure_content_id(&self, expected: &ContentId) -> Result<(), ContentError>
Ok(false). Read moreSource§fn from_canonical_form(bytes: &[u8]) -> Result<Self, ContentError>where
Self: Sized + DeserializeOwned,
fn from_canonical_form(bytes: &[u8]) -> Result<Self, ContentError>where
Self: Sized + DeserializeOwned,
canonical_form. Read more