pub struct NoMemoryError { /* private fields */ }
Expand description
Ruby NoMemoryError
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 NoMemoryError
impl NoMemoryError
Sourcepub const fn new() -> NoMemoryError
pub const fn new() -> NoMemoryError
Construct a new, default NoMemoryError
Ruby exception.
This constructor sets the exception message to NoMemoryError
.
§Examples
let exception = NoMemoryError::new();
assert_eq!(exception.message(), b"NoMemoryError");
Sourcepub const fn with_message(message: &'static str) -> NoMemoryError
pub const fn with_message(message: &'static str) -> NoMemoryError
Construct a new, NoMemoryError
Ruby exception with the given
message.
§Examples
let exception = NoMemoryError::with_message("an error occurred");
assert_eq!(exception.message(), b"an error occurred");
Sourcepub fn message(&self) -> &[u8] ⓘ
pub fn message(&self) -> &[u8] ⓘ
Return the message this Ruby exception was constructed with.
§Examples
let exception = NoMemoryError::new();
assert_eq!(exception.message(), b"NoMemoryError");
let exception = NoMemoryError::from("something went wrong");
assert_eq!(exception.message(), b"something went wrong");
Trait Implementations§
Source§impl Clone for NoMemoryError
impl Clone for NoMemoryError
Source§fn clone(&self) -> NoMemoryError
fn clone(&self) -> NoMemoryError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NoMemoryError
impl Debug for NoMemoryError
Source§impl Default for NoMemoryError
impl Default for NoMemoryError
Source§fn default() -> NoMemoryError
fn default() -> NoMemoryError
Returns the “default value” for a type. Read more
Source§impl Display for NoMemoryError
impl Display for NoMemoryError
Source§impl Error for NoMemoryError
impl Error for NoMemoryError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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 From<&'static [u8]> for NoMemoryError
impl From<&'static [u8]> for NoMemoryError
Source§fn from(message: &'static [u8]) -> NoMemoryError
fn from(message: &'static [u8]) -> NoMemoryError
Converts to this type from the input type.
Source§impl From<&'static str> for NoMemoryError
impl From<&'static str> for NoMemoryError
Source§fn from(message: &'static str) -> NoMemoryError
fn from(message: &'static str) -> NoMemoryError
Converts to this type from the input type.
Source§impl From<NoMemoryError> for Error
impl From<NoMemoryError> for Error
Source§fn from(exception: NoMemoryError) -> Error
fn from(exception: NoMemoryError) -> Error
Converts to this type from the input type.
Source§impl From<String> for NoMemoryError
impl From<String> for NoMemoryError
Source§fn from(message: String) -> NoMemoryError
fn from(message: String) -> NoMemoryError
Converts to this type from the input type.
Source§impl Hash for NoMemoryError
impl Hash for NoMemoryError
Source§impl Ord for NoMemoryError
impl Ord for NoMemoryError
Source§fn cmp(&self, other: &NoMemoryError) -> Ordering
fn cmp(&self, other: &NoMemoryError) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for NoMemoryError
impl PartialEq for NoMemoryError
Source§impl PartialOrd for NoMemoryError
impl PartialOrd for NoMemoryError
Source§impl RubyException for NoMemoryError
impl RubyException for NoMemoryError
Source§impl RubyException for NoMemoryError
impl RubyException for NoMemoryError
Source§fn vm_backtrace(&self, interp: &mut Artichoke) -> Option<Vec<Vec<u8>>>
fn vm_backtrace(&self, interp: &mut Artichoke) -> Option<Vec<Vec<u8>>>
Optional backtrace specified by a
Vec
of frames.Source§fn as_mrb_value(&self, interp: &mut Artichoke) -> Option<mrb_value>
fn as_mrb_value(&self, interp: &mut Artichoke) -> Option<mrb_value>
Return a raise-able
sys::mrb_value
.impl Eq for NoMemoryError
impl StructuralPartialEq for NoMemoryError
Auto Trait Implementations§
impl Freeze for NoMemoryError
impl RefUnwindSafe for NoMemoryError
impl Send for NoMemoryError
impl Sync for NoMemoryError
impl Unpin for NoMemoryError
impl UnwindSafe for NoMemoryError
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