[−][src]Struct artichoke_backend::extn::core::exception::StandardError
Ruby StandardError
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
impl StandardError
[src]
#[must_use]pub const fn new() -> StandardError
[src]
Construct a new, default StandardError
Ruby exception.
This constructor sets the exception message to StandardError
.
Examples
let exception = StandardError::new(); assert_eq!(exception.message(), b"StandardError");
#[must_use]pub const fn with_message(message: &'static str) -> StandardError
[src]
Construct a new, StandardError
Ruby exception with the given
message.
Examples
let exception = StandardError::with_message("an error occurred"); assert_eq!(exception.message(), b"an error occurred");
#[must_use]pub fn message(&self) -> &[u8]
[src]
Return the message this Ruby exception was constructed with.
Examples
let exception = StandardError::new(); assert_eq!(exception.message(), b"StandardError"); let exception = StandardError::from("something went wrong"); assert_eq!(exception.message(), b"something went wrong");
#[must_use]pub const fn name(&self) -> &'static str
[src]
Return this Ruby exception's class name.
Examples
let exception = StandardError::new(); assert_eq!(exception.name(), "StandardError");
Trait Implementations
impl Clone for StandardError
[src]
pub fn clone(&self) -> StandardError
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for StandardError
[src]
impl Default for StandardError
[src]
pub fn default() -> StandardError
[src]
impl Display for StandardError
[src]
impl Eq for StandardError
[src]
impl Error for StandardError
[src]
pub fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
pub fn backtrace(&self) -> Option<&Backtrace>
[src]
pub fn description(&self) -> &str
1.0.0[src]
pub fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl From<&'static [u8]> for StandardError
[src]
pub fn from(message: &'static [u8]) -> StandardError
[src]
impl From<&'static str> for StandardError
[src]
pub fn from(message: &'static str) -> StandardError
[src]
impl From<Cow<'static, [u8]>> for StandardError
[src]
impl From<Cow<'static, str>> for StandardError
[src]
pub fn from(message: Cow<'static, str>) -> StandardError
[src]
impl From<StandardError> for Error
[src]
fn from(exception: StandardError) -> Error
[src]
impl From<String> for StandardError
[src]
pub fn from(message: String) -> StandardError
[src]
impl From<Vec<u8, Global>> for StandardError
[src]
impl Hash for StandardError
[src]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for StandardError
[src]
pub fn cmp(&self, other: &StandardError) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<StandardError> for StandardError
[src]
pub fn eq(&self, other: &StandardError) -> bool
[src]
pub fn ne(&self, other: &StandardError) -> bool
[src]
impl PartialOrd<StandardError> for StandardError
[src]
pub fn partial_cmp(&self, other: &StandardError) -> Option<Ordering>
[src]
pub fn lt(&self, other: &StandardError) -> bool
[src]
pub fn le(&self, other: &StandardError) -> bool
[src]
pub fn gt(&self, other: &StandardError) -> bool
[src]
pub fn ge(&self, other: &StandardError) -> bool
[src]
impl RubyException for StandardError
[src]
impl RubyException for StandardError
[src]
fn message(&self) -> Cow<'_, [u8]>
[src]
fn name(&self) -> Cow<'_, str>
[src]
fn vm_backtrace(&self, interp: &mut Artichoke) -> Option<Vec<Vec<u8>>>
[src]
fn as_mrb_value(&self, interp: &mut Artichoke) -> Option<mrb_value>
[src]
impl StructuralEq for StandardError
[src]
impl StructuralPartialEq for StandardError
[src]
Auto Trait Implementations
impl RefUnwindSafe for StandardError
[src]
impl Send for StandardError
[src]
impl Sync for StandardError
[src]
impl Unpin for StandardError
[src]
impl UnwindSafe for StandardError
[src]
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,
pub 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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,