Trait UtfExt

Source
pub trait UtfExt: UtfExtSealed {
    type UtfSlice: ?Sized;

    // Required method
    fn try_encode_utf8(self, bs: &mut [u8]) -> Option<&mut Self::UtfSlice>;
}

Required Associated Types§

Required Methods§

Source

fn try_encode_utf8(self, bs: &mut [u8]) -> Option<&mut Self::UtfSlice>

Encode the character into the given buffer; return None if the buffer is too short.

Implementations on Foreign Types§

Source§

impl UtfExt for char

Source§

type UtfSlice = str

Source§

fn try_encode_utf8(self, bs: &mut [u8]) -> Option<&mut str>

Source§

impl UtfExt for u32

Source§

type UtfSlice = [u8]

Source§

fn try_encode_utf8(self, bs: &mut [u8]) -> Option<&mut [u8]>

Implementors§