pub struct HoldoutLedger {
pub schema: String,
pub dataset: DatasetId,
pub entries: Vec<LedgerEntry>,
}Fields§
§schema: String§dataset: DatasetId§entries: Vec<LedgerEntry>Implementations§
Source§impl HoldoutLedger
impl HoldoutLedger
Sourcepub fn new(dataset: DatasetId) -> HoldoutLedger
pub fn new(dataset: DatasetId) -> HoldoutLedger
The explicit new ledger of 3.7.3.
Sourcepub fn verify(&self, dataset: &DatasetId) -> Result<(), LedgerError>
pub fn verify(&self, dataset: &DatasetId) -> Result<(), LedgerError>
The schema, the dataset, the bound, every entry’s shape and the chain.
Sourcepub fn head(&self) -> Result<Option<ContentDigest>, LedgerError>
pub fn head(&self) -> Result<Option<ContentDigest>, LedgerError>
The chain digest of the last entry; none for an empty ledger.
Sourcepub fn append(
&self,
dataset: &DatasetId,
a: Append,
) -> Result<(HoldoutLedger, HeldOutRecord), LedgerError>
pub fn append( &self, dataset: &DatasetId, a: Append, ) -> Result<(HoldoutLedger, HeldOutRecord), LedgerError>
Verify this ledger and return a new one with one entry appended,
with the counts and heads a repeat report records. self is never
modified.
Trait Implementations§
Source§impl Clone for HoldoutLedger
impl Clone for HoldoutLedger
Source§impl Debug for HoldoutLedger
impl Debug for HoldoutLedger
Source§impl<'de> Deserialize<'de> for HoldoutLedger
impl<'de> Deserialize<'de> for HoldoutLedger
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
Source§impl Document for HoldoutLedger
impl Document for HoldoutLedger
Source§const SCHEMA: &'static str = HOLDOUT_LEDGER
const SCHEMA: &'static str = HOLDOUT_LEDGER
The schema string this document carries (spec 002, 3.2.1).
Source§const LIMITS: ParseLimits = REPLAY_V1
const LIMITS: ParseLimits = REPLAY_V1
The limit set its bytes are scanned against (spec 002, 3.2.5).
Source§fn parse(bytes: &[u8]) -> Result<Self, DocumentError>
fn parse(bytes: &[u8]) -> Result<Self, DocumentError>
Scan, deserialize and check the schema string.
Source§fn record_canonical(&self) -> Result<Vec<u8>, CanonicalError>where
Self: PartialEq,
fn record_canonical(&self) -> Result<Vec<u8>, CanonicalError>where
Self: PartialEq,
The record canonical bytes (spec 004, 5.6): the canonical bytes, with
finite fractional numbers written in shortest round-trip form.
Source§fn record_digest(&self) -> Result<ContentDigest, CanonicalError>where
Self: PartialEq,
fn record_digest(&self) -> Result<ContentDigest, CanonicalError>where
Self: PartialEq,
sha256(SCHEMA || 0x00 || record canonical bytes) (spec 004, 3.1.6).
Equal to the identity of an identified document.impl Eq for HoldoutLedger
Source§impl Identified for HoldoutLedger
impl Identified for HoldoutLedger
type Id = ContentDigest
Source§impl PartialEq for HoldoutLedger
impl PartialEq for HoldoutLedger
Source§impl Serialize for HoldoutLedger
impl Serialize for HoldoutLedger
impl StructuralPartialEq for HoldoutLedger
Auto Trait Implementations§
impl Freeze for HoldoutLedger
impl RefUnwindSafe for HoldoutLedger
impl Send for HoldoutLedger
impl Sync for HoldoutLedger
impl Unpin for HoldoutLedger
impl UnsafeUnpin for HoldoutLedger
impl UnwindSafe for HoldoutLedger
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