pub struct EncoderReader<R, A, const PAD: bool>where
A: Alphabet,{ /* private fields */ }Expand description
A streaming Base64 encoder for std::io::Read.
Implementations§
Source§impl<R, A, const PAD: bool> EncoderReader<R, A, PAD>where
A: Alphabet,
impl<R, A, const PAD: bool> EncoderReader<R, A, PAD>where
A: Alphabet,
Sourcepub const fn pending_len(&self) -> usize
pub const fn pending_len(&self) -> usize
Returns the number of raw input bytes currently buffered until a complete 3-byte Base64 encode quantum is available.
Sourcepub const fn has_pending_input(&self) -> bool
pub const fn has_pending_input(&self) -> bool
Returns whether this encoder reader currently holds a partial input quantum.
Sourcepub const fn pending_input_needed_len(&self) -> usize
pub const fn pending_input_needed_len(&self) -> usize
Returns how many additional raw input bytes are needed to complete the currently buffered encode quantum.
Returns 0 when no partial input quantum is buffered.
Sourcepub const fn buffered_output_len(&self) -> usize
pub const fn buffered_output_len(&self) -> usize
Returns the number of encoded bytes currently buffered and ready to be read before this adapter polls the wrapped reader again.
Sourcepub const fn buffered_output_capacity(&self) -> usize
pub const fn buffered_output_capacity(&self) -> usize
Returns the maximum number of encoded bytes this adapter can buffer before returning bytes to the caller.
Sourcepub const fn buffered_output_remaining_capacity(&self) -> usize
pub const fn buffered_output_remaining_capacity(&self) -> usize
Returns how many more encoded bytes can be buffered before this adapter must return bytes to the caller.
Sourcepub const fn has_buffered_output(&self) -> bool
pub const fn has_buffered_output(&self) -> bool
Returns whether this encoder reader currently has encoded output waiting in its internal queue.
Sourcepub const fn has_finished_input(&self) -> bool
pub const fn has_finished_input(&self) -> bool
Returns whether this encoder reader has reached EOF in the wrapped reader.
This may become true before Self::is_finished when encoded
output is still buffered for the caller.
Sourcepub const fn is_finished(&self) -> bool
pub const fn is_finished(&self) -> bool
Returns whether this reader has reached EOF and has no encoded output buffered for the caller.
Sourcepub const fn can_into_inner(&self) -> bool
pub const fn can_into_inner(&self) -> bool
Returns whether Self::try_into_inner can recover the wrapped
reader without discarding pending input or buffered encoded output.
Sourcepub fn into_inner(self) -> R
pub fn into_inner(self) -> R
Consumes the encoder reader and returns the wrapped reader.
Sourcepub fn try_into_inner(self) -> Result<R, Self>
pub fn try_into_inner(self) -> Result<R, Self>
Consumes the encoder reader only after the encoded stream is fully drained.
This is a checked alternative to Self::into_inner for callers
that want to avoid accidentally discarding pending input or encoded
output buffered inside the adapter.
Trait Implementations§
Source§impl<R, A, const PAD: bool> Read for EncoderReader<R, A, PAD>
impl<R, A, const PAD: bool> Read for EncoderReader<R, A, PAD>
Source§fn read(&mut self, output: &mut [u8]) -> Result<usize>
fn read(&mut self, output: &mut [u8]) -> Result<usize>
1.36.0 · Source§fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
read, except that it reads into a slice of buffers. Read moreSource§fn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector)1.0.0 · Source§fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
buf. Read more1.0.0 · Source§fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
buf. Read more1.6.0 · Source§fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
buf. Read moreSource§fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
read_buf)Source§fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
read_buf)cursor. Read more1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Read. Read more