pub struct ClientChecksums { /* private fields */ }Expand description
Parsed, byte-length-validated client checksum claims for a single PUT
request. Built once at request entry from the raw header strings;
then handed to tee_into_hashers to drive the streaming verifier.
from_request_fields performs the same pre-stream validation the
buffered path’s verify_client_body_checksums did inline (base64
decodes, byte-length checks) so a malformed header fails with
InvalidDigest before the body ever flows. After this returns
Ok, every present claim has the correct decoded byte length.
Implementations§
Source§impl ClientChecksums
impl ClientChecksums
Sourcepub fn any(&self) -> bool
pub fn any(&self) -> bool
Returns true when at least one checksum claim is set — i.e. the streaming wrapper has work to do. When this returns false the caller should skip the wrapper entirely (zero-cost: no hashers allocated, no per-chunk update path) so non-checksummed PUTs keep their pre-#106 throughput.
Sourcepub fn from_request_fields(
content_md5: Option<&str>,
crc32: Option<&str>,
crc32c: Option<&str>,
sha1: Option<&str>,
sha256: Option<&str>,
crc64nvme: Option<&str>,
) -> S3Result<Self>
pub fn from_request_fields( content_md5: Option<&str>, crc32: Option<&str>, crc32c: Option<&str>, sha1: Option<&str>, sha256: Option<&str>, crc64nvme: Option<&str>, ) -> S3Result<Self>
Parse the six AWS-spec checksum header values supplied on a single
PUT request. Each argument is the base64-encoded header value (or
None when the header was absent). Returns Err(InvalidDigest)
when any present value is malformed (bad base64 or wrong decoded
length); identical pre-stream behaviour to the buffered path’s
inline validation.
Source§impl ClientChecksums
impl ClientChecksums
Sourcepub fn which_hashers(&self) -> WhichHashers
pub fn which_hashers(&self) -> WhichHashers
Project the parsed claim set onto the boolean hasher-selector
used by WhichHashers. A header-supplied claim implies the
hasher must run (for EOF eager-compare).
Trait Implementations§
Source§impl Clone for ClientChecksums
impl Clone for ClientChecksums
Source§fn clone(&self) -> ClientChecksums
fn clone(&self) -> ClientChecksums
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 ClientChecksums
impl Debug for ClientChecksums
Source§impl Default for ClientChecksums
impl Default for ClientChecksums
Source§fn default() -> ClientChecksums
fn default() -> ClientChecksums
Auto Trait Implementations§
impl Freeze for ClientChecksums
impl RefUnwindSafe for ClientChecksums
impl Send for ClientChecksums
impl Sync for ClientChecksums
impl Unpin for ClientChecksums
impl UnsafeUnpin for ClientChecksums
impl UnwindSafe for ClientChecksums
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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