pub struct Latin1Codec;Expand description
Single-byte ISO-8859-1 codec for bytes.
Latin1Codec converts between ISO-8859-1 bytes and Unicode scalar values.
Implementations§
Source§impl Latin1Codec
impl Latin1Codec
Trait Implementations§
Source§impl CharsetCodec for Latin1Codec
impl CharsetCodec for Latin1Codec
Source§fn max_units_per_char(&self) -> usize
fn max_units_per_char(&self) -> usize
Source§fn decode_one(
&self,
input: &[u8],
index: usize,
) -> CharsetDecodeResult<DecodeStatus>
fn decode_one( &self, input: &[u8], index: usize, ) -> CharsetDecodeResult<DecodeStatus>
Decodes one ISO-8859-1 byte into a char.
§Parameters
input: Complete input byte slice.index: Absolute byte index at which decoding starts.
§Returns
Ok(DecodeStatus::Complete { value, consumed: 1 }) always when input exists.
§Errors
Returns CharsetDecodeErrorKind::MalformedSequence when index is out
of range.
Source§fn encode_one(
&self,
ch: char,
output: &mut [u8],
index: usize,
) -> CharsetEncodeResult<usize>
fn encode_one( &self, ch: char, output: &mut [u8], index: usize, ) -> CharsetEncodeResult<usize>
Encodes one char into one ISO-8859-1 byte.
§Parameters
ch: The character to encode.output: Output byte slice.index: Absolute output index where writing starts.
§Returns
Ok(1) when one byte is written.
§Errors
CharsetEncodeErrorKind::BufferTooSmallifindex >= output.len().CharsetEncodeErrorKind::UnmappableCharacterifch>U+00FF.
Source§impl Clone for Latin1Codec
impl Clone for Latin1Codec
Source§fn clone(&self) -> Latin1Codec
fn clone(&self) -> Latin1Codec
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 Latin1Codec
impl Debug for Latin1Codec
Source§impl Default for Latin1Codec
impl Default for Latin1Codec
Source§fn default() -> Latin1Codec
fn default() -> Latin1Codec
Returns the “default value” for a type. Read more
Source§impl Hash for Latin1Codec
impl Hash for Latin1Codec
Source§impl PartialEq for Latin1Codec
impl PartialEq for Latin1Codec
Source§fn eq(&self, other: &Latin1Codec) -> bool
fn eq(&self, other: &Latin1Codec) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for Latin1Codec
impl Eq for Latin1Codec
impl StructuralPartialEq for Latin1Codec
Auto Trait Implementations§
impl Freeze for Latin1Codec
impl RefUnwindSafe for Latin1Codec
impl Send for Latin1Codec
impl Sync for Latin1Codec
impl Unpin for Latin1Codec
impl UnsafeUnpin for Latin1Codec
impl UnwindSafe for Latin1Codec
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