pub struct Checksum {
pub crc32: Option<String>,
pub crc32c: Option<String>,
pub crc64_nvme: Option<String>,
pub sha1: Option<String>,
pub sha256: Option<String>,
}Expand description
Base64-encoded checksums returned by S3.
Fields§
§crc32: Option<String>Base64-encoded CRC-32 value.
crc32c: Option<String>Base64-encoded CRC-32C value.
crc64_nvme: Option<String>Base64-encoded CRC-64/NVME value.
sha1: Option<String>Base64-encoded SHA-1 value.
sha256: Option<String>Base64-encoded SHA-256 value.
Implementations§
Source§impl Checksum
impl Checksum
Sourcepub fn calculate(
algorithm: ChecksumAlgorithm,
bytes: &[u8],
) -> Result<Self, ChecksumCalculationError>
pub fn calculate( algorithm: ChecksumAlgorithm, bytes: &[u8], ) -> Result<Self, ChecksumCalculationError>
Calculates one checksum over bytes using standard S3 wire encoding.
CRC32, CRC32C, CRC64NVME, and SHA-256 are supported. SHA-1 remains an accepted wire value but is not calculated locally.
§Errors
Returns an error when local calculation is unavailable for algorithm.
Trait Implementations§
impl Eq for Checksum
impl StructuralPartialEq for Checksum
Auto Trait Implementations§
impl Freeze for Checksum
impl RefUnwindSafe for Checksum
impl Send for Checksum
impl Sync for Checksum
impl Unpin for Checksum
impl UnsafeUnpin for Checksum
impl UnwindSafe for Checksum
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> ⓘ
Converts
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> ⓘ
Converts
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 moreCreates a shared type from an unshared type.