pub struct CommittedFileEvidence { /* private fields */ }Expand description
Immutable evidence captured when an assembled file is committed.
The fields are intentionally private: every instance is created only after statting its path and checking its recorded size against the expected file length.
Implementations§
Source§impl CommittedFileEvidence
impl CommittedFileEvidence
Sourcepub fn from_full_md5_path(
path: impl AsRef<Path>,
logical_name: impl Into<String>,
expected_length: u64,
md5: [u8; 16],
bound_file_id: Option<FileId>,
) -> Result<Self, EvidenceError>
pub fn from_full_md5_path( path: impl AsRef<Path>, logical_name: impl Into<String>, expected_length: u64, md5: [u8; 16], bound_file_id: Option<FileId>, ) -> Result<Self, EvidenceError>
Capture evidence based on a complete file MD5.
Sourcepub fn from_contiguous_assembly_path(
path: impl AsRef<Path>,
logical_name: impl Into<String>,
expected_length: u64,
crc32: u32,
hash_16k: [u8; 16],
proof: ContiguousAssemblyProof,
bound_file_id: Option<FileId>,
) -> Result<Self, EvidenceError>
pub fn from_contiguous_assembly_path( path: impl AsRef<Path>, logical_name: impl Into<String>, expected_length: u64, crc32: u32, hash_16k: [u8; 16], proof: ContiguousAssemblyProof, bound_file_id: Option<FileId>, ) -> Result<Self, EvidenceError>
Capture evidence based on a contiguous CRC-verified assembly.
Sourcepub fn logical_name(&self) -> &str
pub fn logical_name(&self) -> &str
The logical output name associated with the path.
Sourcepub fn expected_length(&self) -> u64
pub fn expected_length(&self) -> u64
The expected unpadded file length.
Sourcepub fn stat_fingerprint(&self) -> &FileStatFingerprint
pub fn stat_fingerprint(&self) -> &FileStatFingerprint
Immutable stat fingerprint captured from Self::path.
Sourcepub fn bound_file_id(&self) -> Option<FileId>
pub fn bound_file_id(&self) -> Option<FileId>
Optional PAR2 file ID explicitly bound by the caller.
Sourcepub fn file_id(&self) -> Option<FileId>
pub fn file_id(&self) -> Option<FileId>
Alias for Self::bound_file_id.
Sourcepub fn full_md5(&self) -> Option<[u8; 16]>
pub fn full_md5(&self) -> Option<[u8; 16]>
Complete-file MD5 evidence, when that form was captured.
Sourcepub fn assembly_crc32(&self) -> Option<u32>
pub fn assembly_crc32(&self) -> Option<u32>
Complete-file CRC32 from contiguous-assembly evidence, if present.
Sourcepub fn hash_16k(&self) -> Option<[u8; 16]>
pub fn hash_16k(&self) -> Option<[u8; 16]>
MD5 of the first 16 KiB from contiguous-assembly evidence, if present.
Sourcepub fn first_16k_md5(&self) -> Option<[u8; 16]>
pub fn first_16k_md5(&self) -> Option<[u8; 16]>
Alias for Self::hash_16k.
Sourcepub fn assembly_proof(&self) -> Option<&ContiguousAssemblyProof>
pub fn assembly_proof(&self) -> Option<&ContiguousAssemblyProof>
Contiguous-assembly proof, when this evidence was captured that way.
Trait Implementations§
Source§impl Clone for CommittedFileEvidence
impl Clone for CommittedFileEvidence
Source§fn clone(&self) -> CommittedFileEvidence
fn clone(&self) -> CommittedFileEvidence
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CommittedFileEvidence
impl Debug for CommittedFileEvidence
impl Eq for CommittedFileEvidence
Source§impl PartialEq for CommittedFileEvidence
impl PartialEq for CommittedFileEvidence
impl StructuralPartialEq for CommittedFileEvidence
Auto Trait Implementations§
impl Freeze for CommittedFileEvidence
impl RefUnwindSafe for CommittedFileEvidence
impl Send for CommittedFileEvidence
impl Sync for CommittedFileEvidence
impl Unpin for CommittedFileEvidence
impl UnsafeUnpin for CommittedFileEvidence
impl UnwindSafe for CommittedFileEvidence
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more