pub struct AsyncChecksumOutput<O, H> { /* private fields */ }Expand description
Implementations§
Source§impl<O, H> AsyncChecksumOutput<O, H>where
H: Hasher,
impl<O, H> AsyncChecksumOutput<O, H>where
H: Hasher,
Sourcepub const fn inner(&self) -> &O
pub const fn inner(&self) -> &O
Returns a shared reference to the wrapped output.
§Returns
Returns the wrapped asynchronous byte output.
Sourcepub fn inner_mut(&mut self) -> &mut O
pub fn inner_mut(&mut self) -> &mut O
Returns a mutable reference to the wrapped output.
Writes performed directly on the returned output do not update this wrapper’s hasher.
§Returns
Returns the wrapped asynchronous byte output.
Sourcepub fn hasher_mut(&mut self) -> &mut H
pub fn hasher_mut(&mut self) -> &mut H
Returns a mutable reference to the hasher.
Mutating the returned hasher changes the checksum independently of bytes written through this wrapper.
§Returns
Returns the current hasher state mutably.
Sourcepub fn into_parts(self) -> (O, H)
pub fn into_parts(self) -> (O, H)
Consumes this wrapper without flushing the wrapped output.
This method does not call AsyncOutput::flush_async and performs no
asynchronous I/O. Any buffering owned by the returned output remains
pending and unchanged.
§Returns
Returns the wrapped output and final hasher state.
Trait Implementations§
Source§impl<O, H> AsyncClose for AsyncChecksumOutput<O, H>
impl<O, H> AsyncClose for AsyncChecksumOutput<O, H>
Source§fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Polls closing through the wrapped output.
§Parameters
cx: Task context used to register a wake-up.
§Returns
Returns Poll::Pending while closing is incomplete, otherwise a
ready success result.
§Errors
Returns an error reported by the wrapped output. Invalid asynchronous
error kinds are normalized to io::ErrorKind::InvalidData.
Source§fn close_async(&mut self) -> CloseFuture<'_, Self> ⓘ
fn close_async(&mut self) -> CloseFuture<'_, Self> ⓘ
Source§impl<O, H> AsyncOutput for AsyncChecksumOutput<O, H>
impl<O, H> AsyncOutput for AsyncChecksumOutput<O, H>
Source§fn is_buffered(&self) -> bool
fn is_buffered(&self) -> bool
Preserves the wrapped output’s buffering declaration.
§Returns
Returns the wrapped output’s buffering declaration.
Source§unsafe fn poll_write_unchecked(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
input: &[u8],
index: usize,
count: usize,
) -> Poll<Result<usize>>
unsafe fn poll_write_unchecked( self: Pin<&mut Self>, cx: &mut Context<'_>, input: &[u8], index: usize, count: usize, ) -> Poll<Result<usize>>
Polls a write and hashes only bytes in a successful ready result.
§Parameters
cx: Task context used to register a wake-up.input: Source byte slice.index: Starting source index.count: Maximum number of bytes to write.
§Returns
Returns Poll::Pending when the output is not ready. A ready success
contains the number of bytes accepted and hashed.
§Errors
Returns an I/O error reported by the wrapped output without changing the hasher.
§Safety
The range index..index + count must be valid for input.
Source§fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Polls the wrapped output’s flush operation.
§Parameters
cx: Task context used to register a wake-up.
§Returns
Returns Poll::Pending while flushing is incomplete, otherwise a
ready success result.
§Errors
Returns an error reported by the wrapped output. Invalid asynchronous
error kinds are normalized to io::ErrorKind::InvalidData.