pub struct File {
pub version: u32,
pub proofs: Vec<HashedProof>,
}Fields§
§version: u32Version is the version of the proof file.
proofs: Vec<HashedProof>Proofs are the proofs contained within the proof file starting from the genesis proof. Each proof includes its chained hash.
Implementations§
Source§impl File
impl File
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Decodes a File from a byte slice.
Sourcepub fn num_proofs(&self) -> usize
pub fn num_proofs(&self) -> usize
Returns the number of proofs contained in this file.
Sourcepub fn proof_at(&self, index: usize) -> Result<Proof, Error>
pub fn proof_at(&self, index: usize) -> Result<Proof, Error>
Returns the proof at the given index.
Sourcepub fn last_proof(&self) -> Result<Proof, Error>
pub fn last_proof(&self) -> Result<Proof, Error>
Returns the last proof in the chain of proofs.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for File
impl<'de> Deserialize<'de> for File
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 File
impl StructuralPartialEq for File
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnsafeUnpin for File
impl UnwindSafe for File
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