pub struct Utf8Codec;Expand description
UTF-8 content codec.
Bidirectional codec that handles:
- BOM detection and stripping on decode, restoration on encode
- CRLF normalization to LF on decode, restoration on encode
- Clean round-trip:
encode(decode(bytes)) == bytes
Implementations§
Trait Implementations§
Source§impl ContentCodec for Utf8Codec
impl ContentCodec for Utf8Codec
Source§fn decode(&self, raw: &[u8]) -> Result<DecodeResult, CodecError>
fn decode(&self, raw: &[u8]) -> Result<DecodeResult, CodecError>
Decode raw bytes into text. Read more
Auto Trait Implementations§
impl Freeze for Utf8Codec
impl RefUnwindSafe for Utf8Codec
impl Send for Utf8Codec
impl Sync for Utf8Codec
impl Unpin for Utf8Codec
impl UnsafeUnpin for Utf8Codec
impl UnwindSafe for Utf8Codec
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