pub trait U8UtfExt {
    fn extra_utf8_bytes(self) -> Result<usize, Utf8Error>;
    fn extra_utf8_bytes_unchecked(self) -> usize;
}
Expand description

Methods for working with u8s as UTF-8 bytes.

Required Methods

How many more bytes will you need to complete this codepoint?

Errors

An error is returned if the byte is not a valid start of an UTF-8 codepoint:

How many more bytes will you need to complete this codepoint?

This function assumes that the byte is a valid UTF-8 start, and might return any value otherwise. (but the function is safe to call with any value and will return a consistent result).

Implementations on Foreign Types

Implementors