pub struct EncodingDiagnostic {
pub guess: &'static str,
pub first_invalid_byte: Option<usize>,
}Expand description
What diagnose_non_utf8 found about a file that failed UTF-8 decoding.
Fields§
§guess: &'static strBest-effort encoding guess (e.g. "latin-1", "windows-1252", "utf-16le").
first_invalid_byte: Option<usize>Byte offset of the first invalid UTF-8 sequence, when found within the
sampled prefix. None means the sampled prefix was valid UTF-8 and the
offending byte lies further into the file.
Implementations§
Trait Implementations§
Source§impl Clone for EncodingDiagnostic
impl Clone for EncodingDiagnostic
Source§fn clone(&self) -> EncodingDiagnostic
fn clone(&self) -> EncodingDiagnostic
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 EncodingDiagnostic
impl Debug for EncodingDiagnostic
impl Eq for EncodingDiagnostic
Source§impl PartialEq for EncodingDiagnostic
impl PartialEq for EncodingDiagnostic
impl StructuralPartialEq for EncodingDiagnostic
Auto Trait Implementations§
impl Freeze for EncodingDiagnostic
impl RefUnwindSafe for EncodingDiagnostic
impl Send for EncodingDiagnostic
impl Sync for EncodingDiagnostic
impl Unpin for EncodingDiagnostic
impl UnsafeUnpin for EncodingDiagnostic
impl UnwindSafe for EncodingDiagnostic
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