[−][src]Struct sgx_tstd::io::Error
The error type for I/O operations of the [Read
], [Write
], [Seek
], and
associated traits.
Errors mostly originate from the underlying OS, but custom instances of
Error
can be created with crafted error messages and a particular value of
ErrorKind
.
Methods
impl Error
[src]
pub fn new<E>(kind: ErrorKind, error: E) -> Error where
E: Into<Box<dyn Error + Send + Sync>>,
[src]
E: Into<Box<dyn Error + Send + Sync>>,
Creates a new I/O error from a known kind of error as well as an arbitrary error payload.
This function is used to generically create I/O errors which do not
originate from the OS itself. The error
argument is an arbitrary
payload which will be contained in this Error
.
pub fn last_os_error() -> Error
[src]
Returns an error representing the last OS error which occurred.
This function reads the value of errno
for the target platform (e.g.
GetLastError
on Windows) and will return a corresponding instance of
Error
for the error code.
pub fn from_raw_os_error(code: i32) -> Error
[src]
Creates a new instance of an Error
from a particular OS error code.
pub fn raw_os_error(&self) -> Option<i32>
[src]
Returns the OS error that this error represents (if any).
If this Error
was constructed via last_os_error
or
from_raw_os_error
, then this function will return Some
, otherwise
it will return None
.
pub fn from_sgx_error(status: sgx_status_t) -> Error
[src]
Creates a new instance of an Error
from a particular SGX error status.
pub fn raw_sgx_error(&self) -> Option<sgx_status_t>
[src]
Returns the SGX error that this error represents (if any).
If this Error
was constructed via from_sgx_error
or
then this function will return Some
, otherwise
it will return None
.
pub fn get_ref(&self) -> Option<&(dyn Error + Send + Sync + 'static)>
[src]
Returns a reference to the inner error wrapped by this error (if any).
If this Error
was constructed via new
then this function will
return Some
, otherwise it will return None
.
pub fn get_mut(&mut self) -> Option<&mut (dyn Error + Send + Sync + 'static)>
[src]
Returns a mutable reference to the inner error wrapped by this error (if any).
If this Error
was constructed via new
then this function will
return Some
, otherwise it will return None
.
pub fn into_inner(self) -> Option<Box<dyn Error + Send + Sync>>
[src]
Consumes the Error
, returning its inner error (if any).
If this Error
was constructed via new
then this function will
return Some
, otherwise it will return None
.
pub fn kind(&self) -> ErrorKind
[src]
Returns the corresponding ErrorKind
for this error.
Trait Implementations
impl Debug for Error
[src]
impl Display for Error
[src]
impl Error for Error
[src]
fn description(&self) -> &str
[src]
fn cause(&self) -> Option<&dyn Error>
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
[src]
fn type_id(&self, _: Internal) -> TypeId where
Self: 'static,
[src]
Self: 'static,
impl From<ErrorKind> for Error
[src]
Intended for use for errors not exposed to the user, where allocating onto the heap (for normal construction via Error::new) is too costly.
impl<W> From<IntoInnerError<W>> for Error
[src]
fn from(iie: IntoInnerError<W>) -> Error
[src]
impl From<NulError> for Error
[src]
impl From<sgx_status_t> for Error
[src]
fn from(status: sgx_status_t) -> Error
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,