pub struct InvalidUtf8 {
pub lossy: String,
pub offset: usize,
}Expand description
A file whose bytes are not valid UTF-8 (spec chapter 1, rule 1.1).
Fields§
§lossy: StringThe text with invalid sequences replaced by U+FFFD, for showing the error.
offset: usizeByte offset of the first invalid sequence, in both the original bytes and lossy.
Implementations§
Source§impl InvalidUtf8
impl InvalidUtf8
Sourcepub fn diagnostic(&self, file: FileId) -> Diagnostic
pub fn diagnostic(&self, file: FileId) -> Diagnostic
The E0101 diagnostic for this file, once lossy has been added to the source map as
file.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InvalidUtf8
impl RefUnwindSafe for InvalidUtf8
impl Send for InvalidUtf8
impl Sync for InvalidUtf8
impl Unpin for InvalidUtf8
impl UnsafeUnpin for InvalidUtf8
impl UnwindSafe for InvalidUtf8
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