pub struct ChunkDecoder { /* private fields */ }Expand description
A ChunkDecoder can decode an encoded string
and report on any errors that were found / corrected.
Implementations§
Source§impl ChunkDecoder
impl ChunkDecoder
Sourcepub fn decode_chunk(
&self,
encoded_data: &str,
bits: u8,
) -> Result<(DecodedChunk, Option<EncodedChunk>), HumancodeError>
pub fn decode_chunk( &self, encoded_data: &str, bits: u8, ) -> Result<(DecodedChunk, Option<EncodedChunk>), HumancodeError>
Decode and correct an encoded message.
bits much match the value that was passed to encode_chunk
encoded_data should be a value returned by encode_chunk. encoded_data
may include any number of “-” characters which will be ignored.
encoded_data should be validated for the correct length prior to being
passed to this method. Incorrect lengths will result in errors of
type UsageError.
On success, a tuple of DecodedChunk and an Optional EncodedChunk
is returned. The EncodedChunk will only be a Some value if there was
an error in the input that was corrected. It is strongly recommended that
the user be prompted to review any errors.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChunkDecoder
impl RefUnwindSafe for ChunkDecoder
impl Send for ChunkDecoder
impl Sync for ChunkDecoder
impl Unpin for ChunkDecoder
impl UnwindSafe for ChunkDecoder
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