Struct utf8_chars::ReadCharError
source · pub struct ReadCharError { /* private fields */ }
Expand description
A structure, containing read bytes, and an io::Error
.
The io::Error
is an actual I/O error if some occurred,
or a synthetic error with either the UnexpectedEof
kind if a multi-byte char was unexpectedly terminated,
either the InvalidData
kind if no actual I/O error occurred, but read byte sequence was not recognised as a valid UTF-8.
Implementations§
source§impl ReadCharError
impl ReadCharError
sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
A byte sequence, representing an invalid or incomplete UTF-8-encoded char.
sourcepub fn as_io_error(&self) -> &Error
pub fn as_io_error(&self) -> &Error
Returns a reference to the I/O error.
sourcepub fn into_io_error(self) -> Error
pub fn into_io_error(self) -> Error
Consumes the ReadCharError
, returning the I/O error.
Trait Implementations§
source§impl Debug for ReadCharError
impl Debug for ReadCharError
source§impl Display for ReadCharError
impl Display for ReadCharError
source§impl Error for ReadCharError
impl Error for ReadCharError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<ReadCharError> for Error
impl From<ReadCharError> for Error
source§fn from(e: ReadCharError) -> Error
fn from(e: ReadCharError) -> Error
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for ReadCharError
impl Send for ReadCharError
impl Sync for ReadCharError
impl Unpin for ReadCharError
impl !UnwindSafe for ReadCharError
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