Module simdutf8::compat[][src]

The compat API flavor provides full compatibility with std::str::from_utf8() and detailed validation errors.

In particular, from_utf8() returns an Utf8Error, which has the valid_up_to() and error_len() methods. The first is useful for verification of streamed data. The second is useful e.g. for replacing invalid byte sequences with a replacement character.

The functions in this module also fail early: errors are checked on-the-fly as the string is processed and once an invalid UTF-8 sequence is encountered, it returns without processing the rest of the data. This comes at a performance penality compared to the crate::basic module even if the input is valid UTF-8.

Modules

imppublic_imp

Allows direct access to the platform-specific unsafe validation implementations.

Structs

Utf8Error

UTF-8 error information compatible with std::str::Utf8Error.

Functions

from_utf8

Analogue to std::str::from_utf8_mut().

from_utf8_mut

Analogue to std::str::from_utf8_mut().