pub struct IOError { /* private fields */ }
Expand description
Ruby IOError
error type.
Descendants of class Exception
are used to communicate between
Kernel#raise
and rescue
statements in begin ... end
blocks.
Exception objects carry information about the exception – its type (the
exception’s class name), an optional descriptive string, and optional
traceback information. Exception
subclasses may add additional information
like NameError#name
.
Implementations§
source§impl IOError
impl IOError
sourcepub const fn new() -> IOError
pub const fn new() -> IOError
Construct a new, default IOError
Ruby exception.
This constructor sets the exception message to IOError
.
Examples
let exception = IOError::new();
assert_eq!(exception.message(), b"IOError");
sourcepub const fn with_message(message: &'static str) -> IOError
pub const fn with_message(message: &'static str) -> IOError
Construct a new, IOError
Ruby exception with the given
message.
Examples
let exception = IOError::with_message("an error occurred");
assert_eq!(exception.message(), b"an error occurred");
Trait Implementations§
source§impl Error for IOError
impl Error for IOError
1.30.0 · 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 Ord for IOError
impl Ord for IOError
source§impl PartialEq<IOError> for IOError
impl PartialEq<IOError> for IOError
source§impl PartialOrd<IOError> for IOError
impl PartialOrd<IOError> for IOError
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more