pub struct EncoderState { /* private fields */ }Expand description
Heapless ordinary Base64 encoder state.
The state retains at most two incomplete input bytes and one four-byte encoded quantum. It intentionally has no cleanup destructor; secret transforms use a separate state type.
Implementations§
Source§impl EncoderState
impl EncoderState
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 an input prefix and writes as much encoded output as fits.
Sourcepub fn finish(&mut self, output: &mut [u8]) -> Result<Step, OperationError>
pub fn finish(&mut self, output: &mut [u8]) -> Result<Step, OperationError>
Emits the canonical final tail and completes the current message.
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 clear bytes already returned to a caller or copies retained by an input source, allocator, register, cache, swap device, or crash dump.
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 raw input bytes retained until the next complete quantum.
Trait Implementations§
Source§impl Clone for EncoderState
impl Clone for EncoderState
Source§fn clone(&self) -> EncoderState
fn clone(&self) -> EncoderState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more