pub struct ArtifactIdentity {
pub bytes: u64,
pub sha256: Sha256Digest,
}Expand description
Exact size and digest of one bounded byte stream.
Fields§
§bytes: u64Number of bytes successfully read.
sha256: Sha256DigestSHA-256 of those bytes.
Implementations§
Source§impl ArtifactIdentity
impl ArtifactIdentity
Sourcepub fn verify(self, expected: Sha256Digest) -> Result<Self, ArtifactError>
pub fn verify(self, expected: Sha256Digest) -> Result<Self, ArtifactError>
Compare this observed digest with caller-selected authority.
Does not read, hash, freeze or validate the origin of the identity. Size admission and selection of the expected digest remain caller-owned.
§Errors
Returns a typed mismatch retaining the expected digest and this identity.
Trait Implementations§
Source§impl Clone for ArtifactIdentity
impl Clone for ArtifactIdentity
impl Copy for ArtifactIdentity
Source§impl Debug for ArtifactIdentity
impl Debug for ArtifactIdentity
impl Eq for ArtifactIdentity
Source§impl PartialEq for ArtifactIdentity
impl PartialEq for ArtifactIdentity
impl StructuralPartialEq for ArtifactIdentity
Auto Trait Implementations§
impl Freeze for ArtifactIdentity
impl RefUnwindSafe for ArtifactIdentity
impl Send for ArtifactIdentity
impl Sync for ArtifactIdentity
impl Unpin for ArtifactIdentity
impl UnsafeUnpin for ArtifactIdentity
impl UnwindSafe for ArtifactIdentity
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