pub struct Error { /* private fields */ }
Expand description
Implementations§
Source§impl Error
impl Error
Sourcepub fn new<E>(kind: ErrorKind, error: E) -> Error
pub fn new<E>(kind: ErrorKind, error: E) -> Error
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
.
§Examples
use ark_std::io::{Error, ErrorKind};
// errors can be created from strings
let custom_error = Error::new(ErrorKind::Other, "oh no!");
// errors can also be created from other errors
let custom_error2 = Error::new(ErrorKind::Interrupted, custom_error);
pub fn get_ref(&self) -> Option<&(dyn Error + Send + Sync + 'static)>
pub fn get_mut(&mut self) -> Option<&mut (dyn Error + Send + Sync + 'static)>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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