pub struct AsciiCodec;Expand description
Single-byte ASCII codec for bytes.
AsciiCodec converts between one-byte ASCII-encoded data and Unicode scalar
values.
Implementations§
Trait Implementations§
Source§impl CharsetCodec for AsciiCodec
impl CharsetCodec for AsciiCodec
Source§impl CharsetEncodeProbe for AsciiCodec
impl CharsetEncodeProbe for AsciiCodec
Source§fn encode_len(&self, ch: char, index: usize) -> CharsetEncodeResult<usize>
fn encode_len(&self, ch: char, index: usize) -> CharsetEncodeResult<usize>
Source§impl Clone for AsciiCodec
impl Clone for AsciiCodec
Source§fn clone(&self) -> AsciiCodec
fn clone(&self) -> AsciiCodec
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 Codec for AsciiCodec
impl Codec for AsciiCodec
Source§type DecodeError = CharsetDecodeError
type DecodeError = CharsetDecodeError
Error reported when decoding malformed units.
Source§type EncodeError = CharsetEncodeError
type EncodeError = CharsetEncodeError
Error reported when encoding an unsupported value.
Source§fn min_units_per_value(&self) -> NonZeroUsize
fn min_units_per_value(&self) -> NonZeroUsize
Returns the minimum possible unit count for one encoded value. Read more
Source§fn max_units_per_value(&self) -> NonZeroUsize
fn max_units_per_value(&self) -> NonZeroUsize
Returns the maximum non-zero unit count needed to encode or decode one value. Read more
Source§unsafe fn decode_unchecked(
&self,
input: &[u8],
index: usize,
) -> CharsetDecodeResult<(char, NonZeroUsize)>
unsafe fn decode_unchecked( &self, input: &[u8], index: usize, ) -> CharsetDecodeResult<(char, NonZeroUsize)>
Source§unsafe fn encode_unchecked(
&self,
ch: &char,
output: &mut [u8],
index: usize,
) -> CharsetEncodeResult<usize>
unsafe fn encode_unchecked( &self, ch: &char, output: &mut [u8], index: usize, ) -> CharsetEncodeResult<usize>
impl Copy for AsciiCodec
Source§impl Debug for AsciiCodec
impl Debug for AsciiCodec
Source§impl Default for AsciiCodec
impl Default for AsciiCodec
Source§fn default() -> AsciiCodec
fn default() -> AsciiCodec
Returns the “default value” for a type. Read more
impl Eq for AsciiCodec
Source§impl Hash for AsciiCodec
impl Hash for AsciiCodec
Source§impl PartialEq for AsciiCodec
impl PartialEq for AsciiCodec
Source§fn eq(&self, other: &AsciiCodec) -> bool
fn eq(&self, other: &AsciiCodec) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AsciiCodec
Auto Trait Implementations§
impl Freeze for AsciiCodec
impl RefUnwindSafe for AsciiCodec
impl Send for AsciiCodec
impl Sync for AsciiCodec
impl Unpin for AsciiCodec
impl UnsafeUnpin for AsciiCodec
impl UnwindSafe for AsciiCodec
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