pub struct TryFromUtf8Error<'s, S: ?Sized> { /* private fields */ }Expand description
An error signifying that a buffer was too small, when trying to convert UTF8 to another string type.
This type contains information necessary to continue the conversion into an owned type without repeating checks.
Implementations§
Source§impl<'s, S: ?Sized> TryFromUtf8Error<'s, S>
impl<'s, S: ?Sized> TryFromUtf8Error<'s, S>
Sourcepub fn bytes_read(&self) -> usize
pub fn bytes_read(&self) -> usize
The number of bytes consumed from the source string
Sourcepub fn bytes_written(&self) -> usize
pub fn bytes_written(&self) -> usize
The number of bytes written to the destination buffer
Sourcepub fn source_str(&self) -> &str
pub fn source_str(&self) -> &str
The original source string to convert
Sourcepub fn source_str_used(&self) -> &str
pub fn source_str_used(&self) -> &str
The portion of the source string that was converted
Sourcepub fn source_str_rest(&self) -> &str
pub fn source_str_rest(&self) -> &str
The portion of the source string that is left to convert
Sourcepub fn encoded_bytes(&self) -> &[u8] ⓘ
pub fn encoded_bytes(&self) -> &[u8] ⓘ
The portion of the user buffer that has been encoded. Note that it will not contain a nul-byte, if required for the string encoding. It should however, be valid other than that (particularly, partial codepoints should not exist)
Source§impl<'s> TryFromUtf8Error<'s, Cesu8Str>
impl<'s> TryFromUtf8Error<'s, Cesu8Str>
Source§impl<'s> TryFromUtf8Error<'s, Mutf8Str>
impl<'s> TryFromUtf8Error<'s, Mutf8Str>
Trait Implementations§
Source§impl<'s, S: Clone + ?Sized> Clone for TryFromUtf8Error<'s, S>
impl<'s, S: Clone + ?Sized> Clone for TryFromUtf8Error<'s, S>
Source§fn clone(&self) -> TryFromUtf8Error<'s, S>
fn clone(&self) -> TryFromUtf8Error<'s, S>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'s, S: PartialEq + ?Sized> PartialEq for TryFromUtf8Error<'s, S>
impl<'s, S: PartialEq + ?Sized> PartialEq for TryFromUtf8Error<'s, S>
Source§fn eq(&self, other: &TryFromUtf8Error<'s, S>) -> bool
fn eq(&self, other: &TryFromUtf8Error<'s, S>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'s, S: Copy + ?Sized> Copy for TryFromUtf8Error<'s, S>
impl<'s, S: Eq + ?Sized> Eq for TryFromUtf8Error<'s, S>
impl<'s, S: ?Sized> StructuralPartialEq for TryFromUtf8Error<'s, S>
Auto Trait Implementations§
impl<'s, S> Freeze for TryFromUtf8Error<'s, S>where
S: ?Sized,
impl<'s, S> RefUnwindSafe for TryFromUtf8Error<'s, S>where
S: RefUnwindSafe + ?Sized,
impl<'s, S> Send for TryFromUtf8Error<'s, S>
impl<'s, S> Sync for TryFromUtf8Error<'s, S>
impl<'s, S> Unpin for TryFromUtf8Error<'s, S>
impl<'s, S> UnwindSafe for TryFromUtf8Error<'s, S>where
S: UnwindSafe + ?Sized,
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