Struct arc_io_error::IoError
[−]
[src]
pub struct IoError(_);
A version of
std::io::Error
implemented on top of
Arc
instead of
Box
,
making it cloneable.
The API of this type has been designed to match
io::Error
, with
two exceptions:
IoError::new
andIoError::into_inner
substituteArc
forBox
, andIoError
has no equivalent toio::Error::get_mut
, as the inner error instance is shared.
See the standard library documentation for more detailed API-level descriptions than are given here.
IoError
implements
From
for io::Error
and vice-versa, so the two types can easily be converted between each other.
A type containing
io::Error
can
be made
Clone
-compatible
by instead storing IoError
internally and
converting from/to
io::Error
on
API boundaries.
Clones derived from the same original IoError
instance will share a single heap-allocated error instance (if one is
present) using
Arc
.
io::Error
instances produced by converting those clones back with the
From
implementation will also share the same single error instance.
Methods
impl IoError
[src]
fn new<E>(kind: IoErrorKind, error: E) -> Self where
E: Into<Arc<Error + Send + Sync>>,
E: Into<Arc<Error + Send + Sync>>,
See
io::Error::new
,
with
Arc
substituted for
Box
.
fn last_os_error() -> Self
fn from_raw_os_error(code: i32) -> Self
fn raw_os_error(&self) -> Option<i32>
fn get_ref(&self) -> Option<&(Error + Send + Sync + 'static)>
See
io::Error::get_ref
.
fn into_inner(self) -> Option<Arc<Error + Send + Sync>>
See
io::Error::into_inner
,
with
Arc
substituted for
Box
.
fn kind(&self) -> IoErrorKind
See
io::Error::kind
.
Trait Implementations
impl Clone for IoError
[src]
fn clone(&self) -> IoError
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl From<Error> for IoError
[src]
impl From<IoErrorKind> for IoError
[src]
fn from(src: IoErrorKind) -> IoError
Performs the conversion.