pub struct Error { /* private fields */ }
Expand description
The error type for zero-copy I/O operations of the Read
and Write
traits.
When std
is enabled this becomes a zero-cost abstraction over
io::Error
. In no_std
environments, error messages are preserved while
io::ErrorKind
information is stripped.
If you are working in an environment that may be no_std
, and you need to
create an Error
yourself, use the error!
macro.
Implementations§
source§impl Error
impl Error
sourcepub fn new<E>(kind: ErrorKind, error: E) -> Errorwhere
E: Into<Box<dyn Error + Send + Sync>>,
Available on crate feature std
only.
pub fn new<E>(kind: ErrorKind, error: E) -> Errorwhere
E: Into<Box<dyn Error + Send + Sync>>,
std
only.Creates a new I/O error from a known kind of error as well as an arbitrary error payload.
For more information, refer to io::Error::new
.
sourcepub fn other<E>(error: E) -> Errorwhere
E: Into<Box<dyn Error + Send + Sync>>,
Available on crate feature std
only.
pub fn other<E>(error: E) -> Errorwhere
E: Into<Box<dyn Error + Send + Sync>>,
std
only.Creates a new I/O error from an arbitrary error payload.
For more information, refer to io::Error::other
.
sourcepub fn last_os_error() -> Error
Available on crate feature std
only.
pub fn last_os_error() -> Error
std
only.Returns an error representing the last OS error which occurred.
For more information, refer to io::Error::last_os_error
.
sourcepub fn from_raw_os_error(code: i32) -> Error
Available on crate feature std
only.
pub fn from_raw_os_error(code: i32) -> Error
std
only.Creates a new instance of an Error from a particular OS error code.
For more information, refer to io::Error::from_raw_os_error
.
sourcepub fn raw_os_error(&self) -> Option<i32>
Available on crate feature std
only.
pub fn raw_os_error(&self) -> Option<i32>
std
only.Returns the OS error that this error represents (if any).
For more information, refer to io::Error::raw_os_error
.
sourcepub fn get_ref(&self) -> Option<&(dyn Error + Send + Sync + 'static)>
Available on crate feature std
only.
pub fn get_ref(&self) -> Option<&(dyn Error + Send + Sync + 'static)>
std
only.Returns a reference to the inner error wrapped by this error (if any).
For more information, refer to io::Error::get_ref
.
sourcepub fn get_mut(&mut self) -> Option<&mut (dyn Error + Send + Sync + 'static)>
Available on crate feature std
only.
pub fn get_mut(&mut self) -> Option<&mut (dyn Error + Send + Sync + 'static)>
std
only.Returns a mutable reference to the inner error wrapped by this error (if any).
For more information, refer to io::Error::get_mut
.
sourcepub fn into_inner(self) -> Option<Box<dyn Error + Send + Sync>>
Available on crate feature std
only.
pub fn into_inner(self) -> Option<Box<dyn Error + Send + Sync>>
std
only.Consumes the Error, returning its inner error (if any).
For more information, refer to io::Error::into_inner
.
sourcepub fn kind(&self) -> ErrorKind
Available on crate feature std
only.
pub fn kind(&self) -> ErrorKind
std
only.Returns the corresponding ErrorKind
for this error.
For more information, refer to io::Error::kind
.
Trait Implementations§
source§impl Error for Error
Available on crate feature std
only.
impl Error for Error
std
only.source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<Error> for Error
Available on crate feature std
only.
impl From<Error> for Error
std
only.Converts an io::Error
to a zc_io::Error
.
source§impl From<Error> for Error
Available on crate feature std
only.
impl From<Error> for Error
std
only.Converts a zc_io::Error
to an io::Error
.
source§impl<W> From<IntoInnerError<W>> for Error
Available on crate feature std
only.
impl<W> From<IntoInnerError<W>> for Error
std
only.