pub struct DecoderState { /* private fields */ }Expand description
Heapless strict Base64 decoder state.
The current input quantum and pending output quantum are mutually exclusive. This keeps retry state bounded while allowing one-byte output destinations without asking the caller to replay accepted input.
Implementations§
Source§impl DecoderState
impl DecoderState
Sourcepub fn update(
&mut self,
input: &[u8],
output: &mut [u8],
) -> Result<Step, OperationError>
pub fn update( &mut self, input: &[u8], output: &mut [u8], ) -> Result<Step, OperationError>
Accepts a strict padded input prefix and writes decoded output that fits.
Sourcepub fn finish(&mut self, output: &mut [u8]) -> Result<Step, OperationError>
pub fn finish(&mut self, output: &mut [u8]) -> Result<Step, OperationError>
Declares end of input and resolves the selected padding policy.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears retained ordinary input and output through the reviewed wipe boundary, then resets the state for reuse.
This is explicit best-effort cleanup. It cannot retract plaintext already returned to a caller or clear copies outside this state.
Sourcepub const fn source_position(&self) -> usize
pub const fn source_position(&self) -> usize
Returns the absolute number of input bytes accepted since reset.
Sourcepub const fn buffered_input_len(&self) -> usize
pub const fn buffered_input_len(&self) -> usize
Returns encoded input bytes retained until the next complete quantum.
Sourcepub const fn has_terminal_padding(&self) -> bool
pub const fn has_terminal_padding(&self) -> bool
Returns whether a terminal padded quantum has been accepted.
Trait Implementations§
Source§impl Clone for DecoderState
impl Clone for DecoderState
Source§fn clone(&self) -> DecoderState
fn clone(&self) -> DecoderState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more