#[non_exhaustive]pub enum Utf8Decode {
Clean,
TruncatedCodepoint {
at: usize,
},
InvalidBytes {
at: usize,
},
}Expand description
Outcome of classifying a line’s bytes as UTF-8.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Clean
Valid UTF-8 throughout.
TruncatedCodepoint
One or more incomplete multibyte sequences — mod_logfile’s 2 KiB buffer
chopping a codepoint mid-character. Benign and recoverable. at is the
byte offset of the first truncation.
InvalidBytes
A byte that cannot be part of any UTF-8 sequence — genuine corruption.
at is the byte offset of the first invalid byte.
Trait Implementations§
Source§impl Clone for Utf8Decode
impl Clone for Utf8Decode
Source§fn clone(&self) -> Utf8Decode
fn clone(&self) -> Utf8Decode
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 Utf8Decode
impl Debug for Utf8Decode
impl Eq for Utf8Decode
Source§impl PartialEq for Utf8Decode
impl PartialEq for Utf8Decode
Source§fn eq(&self, other: &Utf8Decode) -> bool
fn eq(&self, other: &Utf8Decode) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Utf8Decode
Auto Trait Implementations§
impl Freeze for Utf8Decode
impl RefUnwindSafe for Utf8Decode
impl Send for Utf8Decode
impl Sync for Utf8Decode
impl Unpin for Utf8Decode
impl UnsafeUnpin for Utf8Decode
impl UnwindSafe for Utf8Decode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.