pub struct ToStrError { /* private fields */ }Expand description
Errors which can occur when converting Wtf8 to str.
Implementations§
Source§impl ToStrError
impl ToStrError
Sourcepub fn valid_up_to(&self) -> usize
pub fn valid_up_to(&self) -> usize
Returns the index in the given string up to which valid UTF-8 was verified.
It is the maximum index such that wstr[..index].to_str() would
return Ok(_).
Sourcepub fn error_len(&self) -> usize
pub fn error_len(&self) -> usize
The length provided is that of the invalid byte sequence
that starts at the index given by valid_up_to().
Decoding should resume after that sequence
(after inserting a U+FFFD REPLACEMENT CHARACTER) in case
of lossy decoding.
Trait Implementations§
Source§impl Clone for ToStrError
impl Clone for ToStrError
Source§fn clone(&self) -> ToStrError
fn clone(&self) -> ToStrError
Returns a duplicate of the value. Read more
1.0.0 · 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 ToStrError
impl Debug for ToStrError
Source§impl Display for ToStrError
impl Display for ToStrError
Source§impl Ord for ToStrError
impl Ord for ToStrError
Source§fn cmp(&self, other: &ToStrError) -> Ordering
fn cmp(&self, other: &ToStrError) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ToStrError
impl PartialEq for ToStrError
Source§impl PartialOrd for ToStrError
impl PartialOrd for ToStrError
impl Copy for ToStrError
impl Eq for ToStrError
impl StructuralPartialEq for ToStrError
Auto Trait Implementations§
impl Freeze for ToStrError
impl RefUnwindSafe for ToStrError
impl Send for ToStrError
impl Sync for ToStrError
impl Unpin for ToStrError
impl UnwindSafe for ToStrError
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