[][src]Struct rosy::AnyException

#[repr(transparent)]
pub struct AnyException(_);

Any Ruby exception.

Methods

impl AnyException[src]

pub fn new(message: impl Into<String>) -> Self[src]

Creates a new instance of Exception with message.

pub unsafe fn of_class(
    class: impl Into<Class>,
    message: impl Into<String>
) -> Self
[src]

Creates a new instance of class with message.

Safety

The class argument must inherit from an exception class.

pub fn current() -> Option<AnyException>[src]

Returns the current pending exception.

pub fn take_current() -> Option<AnyException>[src]

Returns the current pending exception, removing it from its global spot.

pub fn is_standard_error(self) -> bool[src]

Returns whether self is a StandardError.

pub fn is_system_exit(self) -> bool[src]

Returns whether self is a SystemExit.

pub fn is_interrupt(self) -> bool[src]

Returns whether self is a Interrupt.

pub fn is_signal(self) -> bool[src]

Returns whether self is a Signal.

pub fn is_fatal(self) -> bool[src]

Returns whether self is a Fatal.

pub fn is_arg_error(self) -> bool[src]

Returns whether self is a ArgumentError.

pub fn is_eof_error(self) -> bool[src]

Returns whether self is a EOFError.

pub fn is_index_error(self) -> bool[src]

Returns whether self is a IndexError.

pub fn is_stop_iteration(self) -> bool[src]

Returns whether self is a StopIteration.

pub fn is_key_error(self) -> bool[src]

Returns whether self is a KeyError.

pub fn is_range_error(self) -> bool[src]

Returns whether self is a RangeError.

pub fn is_io_error(self) -> bool[src]

Returns whether self is a IOError.

pub fn is_runtime_error(self) -> bool[src]

Returns whether self is a RuntimeError.

pub fn is_frozen_error(self) -> bool[src]

Returns whether self is a FrozenError.

pub fn is_security_error(self) -> bool[src]

Returns whether self is a SecurityError.

pub fn is_system_call_error(self) -> bool[src]

Returns whether self is a SystemCallError.

pub fn is_thread_error(self) -> bool[src]

Returns whether self is a ThreadError.

pub fn is_type_error(self) -> bool[src]

Returns whether self is a TypeError.

pub fn is_zero_div_error(self) -> bool[src]

Returns whether self is a ZeroDivError.

pub fn is_not_imp_error(self) -> bool[src]

Returns whether self is a NotImpError.

pub fn is_no_mem_error(self) -> bool[src]

Returns whether self is a NoMemError.

pub fn is_no_method_error(self) -> bool[src]

Returns whether self is a NoMethodError.

pub fn is_float_domain_error(self) -> bool[src]

Returns whether self is a FloatDomainErr.

pub fn is_local_jump_error(self) -> bool[src]

Returns whether self is a LocalJumpError.

pub fn is_sys_stack_error(self) -> bool[src]

Returns whether self is a SysStackError.

pub fn is_regexp_error(self) -> bool[src]

Returns whether self is a RegexpError.

pub fn is_encoding_error(self) -> bool[src]

Returns whether self is a EncodingError.

pub fn is_enc_compat_error(self) -> bool[src]

Returns whether self is a EncCompatError.

pub fn is_script_error(self) -> bool[src]

Returns whether self is a ScriptError.

pub fn is_name_error(self) -> bool[src]

Returns whether self is a NameError.

pub fn is_syntax_error(self) -> bool[src]

Returns whether self is a SyntaxError.

pub fn is_load_error(self) -> bool[src]

Returns whether self is a LoadError.

pub fn is_math_domain_error(self) -> bool[src]

Returns whether self is a MathDomainError.

Trait Implementations

impl Exception for AnyException[src]

fn into_any_exception(self) -> AnyException[src]

Returns self as an AnyException.

fn as_any_exception(&self) -> &AnyException[src]

Returns a reference to self as an AnyObject.

unsafe fn raise(self) -> ![src]

Raises the exception. Read more

fn backtrace(&self) -> Option<Array<String>>[src]

Returns a backtrace associated with self.

fn cause(&self) -> Option<AnyException>[src]

The underlying exception that caused self.

impl Classify for AnyException[src]

impl Object for AnyException[src]

fn unique_id() -> Option<u128>[src]

Returns a unique identifier for an object type to facilitate casting. Read more

unsafe fn from_raw(raw: usize) -> Self[src]

Creates a new object from raw without checking. Read more

unsafe fn cast_unchecked(obj: impl Object) -> Self[src]

Casts obj to Self without checking its type.

fn into_any_object(self) -> AnyObject[src]

Returns self as an AnyObject.

fn as_any_object(&self) -> &AnyObject[src]

Returns a reference to self as an AnyObject.

fn as_any_slice(&self) -> &[AnyObject][src]

Returns self as a reference to a single-element slice.

fn raw(self) -> usize[src]

Returns the raw object pointer.

unsafe fn as_unchecked<O: Object>(&self) -> &O[src]

Casts self to O without checking whether it is one.

unsafe fn into_unchecked<O: Object>(self) -> O[src]

Converts self to O without checking whether it is one.

fn id(self) -> u64[src]

Returns the object's identifier.

fn ty(self) -> Ty[src]

Returns the virtual type of self.

fn is_ty(self, ty: Ty) -> bool[src]

Returns whether the virtual type of self is ty.

fn class(self) -> Class<Self>[src]

Returns the Class for self. Read more

fn singleton_class(self) -> Class<Self>[src]

Returns the singleton Class of self, creating one if it doesn't exist already. Read more

fn mark(self)[src]

Marks self for Ruby to avoid garbage collecting it.

unsafe fn force_recycle(self)[src]

Forces the garbage collector to free the contents of self. Read more

fn def_singleton_method<N, F>(self, name: N, f: F) -> Result where
    N: Into<SymbolId>,
    F: MethodFn<Self>, 
[src]

Defines a method for name on the singleton class of self that calls f when invoked. Read more

unsafe fn def_singleton_method_unchecked<N, F>(self, name: N, f: F) where
    N: Into<SymbolId>,
    F: MethodFn<Self>, 
[src]

Defines a method for name on the singleton class of self that calls f when invoked. Read more

unsafe fn call(self, method: impl Into<SymbolId>) -> AnyObject[src]

Calls method on self and returns its output. Read more

unsafe fn call_protected(self, method: impl Into<SymbolId>) -> Result<AnyObject>[src]

Calls method on self and returns its output, or an exception if one is raised. Read more

unsafe fn call_with(
    self,
    method: impl Into<SymbolId>,
    args: &[impl Object]
) -> AnyObject
[src]

Calls method on self with args and returns its output. Read more

unsafe fn call_with_protected(
    self,
    method: impl Into<SymbolId>,
    args: &[impl Object]
) -> Result<AnyObject>
[src]

Calls method on self with args and returns its output, or an exception if one is raised. Read more

unsafe fn call_public(self, method: impl Into<SymbolId>) -> AnyObject[src]

Calls the public method on self and returns its output. Read more

unsafe fn call_public_protected(
    self,
    method: impl Into<SymbolId>
) -> Result<AnyObject>
[src]

Calls the public method on self and returns its output, or an exception if one is raised. Read more

unsafe fn call_public_with(
    self,
    method: impl Into<SymbolId>,
    args: &[impl Object]
) -> AnyObject
[src]

Calls the public method on self with args and returns its output. Read more

unsafe fn call_public_with_protected(
    self,
    method: impl Into<SymbolId>,
    args: &[impl Object]
) -> Result<AnyObject>
[src]

Calls the public method on self with args and returns its output, or an exception if one is raised. Read more

fn inspect(self) -> String[src]

Returns a printable string representation of self. Read more

fn to_s(self) -> String[src]

Returns the result of calling the to_s method on self.

fn is_frozen(self) -> bool[src]

Returns whether modifications can be made to self.

fn freeze(self)[src]

Freezes self, preventing any further mutations.

fn is_eql<O: Object>(self, other: &O) -> bool[src]

Returns whether self is equal to other in terms of the eql? method. Read more

fn get_attr<N: Into<SymbolId>>(self, name: N) -> AnyObject[src]

Returns the value for the attribute of self associated with name.

unsafe fn eval(self, args: impl EvalArgs) -> AnyObject[src]

Evaluates args in the context of self. Read more

unsafe fn eval_protected(self, args: impl EvalArgs) -> Result<AnyObject>[src]

Evaluates args in the context of self, returning any raised exceptions. Read more

impl Eq for AnyException[src]

impl<O: Object> PartialEq<O> for AnyException[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl Copy for AnyException[src]

impl Clone for AnyException[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl AsRef<AnyObject> for AnyException[src]

impl From<AnyException> for AnyObject[src]

impl From<Infallible> for AnyException[src]

impl Debug for AnyException[src]

impl Display for AnyException[src]

impl Error for AnyException[src]

fn description(&self) -> &str1.0.0[src]

This method is soft-deprecated. Read more

fn cause(&self) -> Option<&dyn Error>1.0.0[src]

Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

The lower-level cause of this error, if any. Read more

fn source(&self) -> Option<&(dyn Error + 'static)>1.30.0[src]

The lower-level source of this error, if any. Read more

Auto Trait Implementations

impl !Send for AnyException

impl !Sync for AnyException

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]