pub struct Decoded<'a> { /* private fields */ }Expand description
Decoded input: the text, how it was encoded, and any decoding problems.
Implementations§
Source§impl<'a> Decoded<'a>
impl<'a> Decoded<'a>
Sourcepub fn text(&self) -> &str
pub fn text(&self) -> &str
The decoded text, byte order marks included. Borrowed from the input for valid UTF-8.
Sourcepub const fn encoder(&self) -> Encoder
pub const fn encoder(&self) -> Encoder
The encoder that writes text back in the detected encoding.
Sourcepub fn invalid_runs(&self) -> &InvalidRuns
pub fn invalid_runs(&self) -> &InvalidRuns
The invalid runs, in input order.
Sourcepub fn diagnostics(&self) -> &[Diagnostic]
pub fn diagnostics(&self) -> &[Diagnostic]
One error diagnostic per invalid run, in order; empty for valid
input. With decode_with_limit, those of the first runs only
(see Decoded::suppressed_diagnostics).
Sourcepub const fn suppressed_diagnostics(&self) -> usize
pub const fn suppressed_diagnostics(&self) -> usize
How many invalid runs have no built diagnostic (past the
budget of decode_with_limit); Decoded::invalid_runs is
always complete, and run_diagnostic builds any run’s.
Sourcepub fn into_parts(self) -> (Vec<Diagnostic>, InvalidRuns, Encoder, Cow<'a, str>)
pub fn into_parts(self) -> (Vec<Diagnostic>, InvalidRuns, Encoder, Cow<'a, str>)
Takes self apart (no copy of the runs): the built
diagnostics, the invalid runs, the encoder, and the text.
Trait Implementations§
impl<'a> Eq for Decoded<'a>
impl<'a> StructuralPartialEq for Decoded<'a>
Auto Trait Implementations§
impl<'a> Freeze for Decoded<'a>
impl<'a> RefUnwindSafe for Decoded<'a>
impl<'a> Send for Decoded<'a>
impl<'a> Sync for Decoded<'a>
impl<'a> Unpin for Decoded<'a>
impl<'a> UnsafeUnpin for Decoded<'a>
impl<'a> UnwindSafe for Decoded<'a>
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