pub struct ForgivingDecoder { /* private fields */ }Expand description
Heapless incremental WHATWG forgiving Base64 decoder.
State is bounded to one input quantum and one pending output quantum. This ordinary compatibility state does not wipe on drop and must not be used for secret-bearing input.
Implementations§
Source§impl ForgivingDecoder
impl ForgivingDecoder
Sourcepub fn update(
&mut self,
input: &str,
output: &mut [u8],
) -> Result<Step, ForgivingError>
pub fn update( &mut self, input: &str, output: &mut [u8], ) -> Result<Step, ForgivingError>
Accepts one string fragment and writes every decoded byte that fits.
input_consumed counts UTF-8 bytes. Every accepted WHATWG symbol is
ASCII, so a successful partial count is always a valid string boundary.
Sourcepub fn finish(&mut self, output: &mut [u8]) -> Result<Step, ForgivingError>
pub fn finish(&mut self, output: &mut [u8]) -> Result<Step, ForgivingError>
Finalizes omitted padding and drains any bounded pending output.
Sourcepub const fn source_position(&self) -> usize
pub const fn source_position(&self) -> usize
Returns the number of UTF-8 source bytes accepted since reset.
Trait Implementations§
Source§impl Clone for ForgivingDecoder
impl Clone for ForgivingDecoder
Source§fn clone(&self) -> ForgivingDecoder
fn clone(&self) -> ForgivingDecoder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ForgivingDecoder
impl Debug for ForgivingDecoder
impl Eq for ForgivingDecoder
Source§impl PartialEq for ForgivingDecoder
impl PartialEq for ForgivingDecoder
impl StructuralPartialEq for ForgivingDecoder
Auto Trait Implementations§
impl Freeze for ForgivingDecoder
impl RefUnwindSafe for ForgivingDecoder
impl Send for ForgivingDecoder
impl Sync for ForgivingDecoder
impl Unpin for ForgivingDecoder
impl UnsafeUnpin for ForgivingDecoder
impl UnwindSafe for ForgivingDecoder
Blanket Implementations§
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
Mutably borrows from an owned value. Read more