pub struct AnyObject { /* private fields */ }Expand description
An instance of any Ruby object.
Implementations§
Source§impl AnyObject
impl AnyObject
Sourcepub fn convert_slice(objects: &[impl Object]) -> &[AnyObject]
pub fn convert_slice(objects: &[impl Object]) -> &[AnyObject]
Casts the concrete slice objects into a slice of AnyObject.
Sourcepub fn call_super() -> Result<AnyObject>
pub fn call_super() -> Result<AnyObject>
Calls super on the current receiver without any arguments in the
context of a method.
Sourcepub unsafe fn call_super_unchecked() -> AnyObject
pub unsafe fn call_super_unchecked() -> AnyObject
Calls super on the current receiver without any arguments in the
context of a method, without checking for an exception.
Sourcepub fn call_super_with(args: &[impl Object]) -> Result<AnyObject>
pub fn call_super_with(args: &[impl Object]) -> Result<AnyObject>
Calls super on the current receiver with args in the context of a
method.
Sourcepub unsafe fn call_super_with_unchecked(args: &[impl Object]) -> AnyObject
pub unsafe fn call_super_with_unchecked(args: &[impl Object]) -> AnyObject
Calls super on the current receiver with args in the context of a
method, without checking for an exception.
Sourcepub const unsafe fn from_raw(raw: usize) -> AnyObject
pub const unsafe fn from_raw(raw: usize) -> AnyObject
An alternative to
Object::from_raw that works in a
const context.
Sourcepub const fn is_undefined(self) -> bool
pub const fn is_undefined(self) -> bool
Returns whether self is undefined.
Sourcepub fn is_integer(self) -> bool
pub fn is_integer(self) -> bool
Returns whether self is a fixed-sized number.
Sourcepub fn to_integer(self) -> Option<Integer>
pub fn to_integer(self) -> Option<Integer>
Returns self as an Integer if it is one.
Sourcepub fn to_array(self) -> Option<Array>
pub fn to_array(self) -> Option<Array>
Returns self as an Array if it is one.
§Safety
If self refers to an Array<X> and after this method objects of type
Y are inserted, expect
nasal demons. You’ve been
warned.
Sourcepub fn is_exception(self) -> bool
pub fn is_exception(self) -> bool
Returns whether self is an Exception.
Sourcepub fn to_exception(self) -> Option<AnyException>
pub fn to_exception(self) -> Option<AnyException>
Returns self as an AnyException if it is one.
Trait Implementations§
Source§impl AsRef<AnyObject> for AnyException
impl AsRef<AnyObject> for AnyException
Source§impl From<AnyException> for AnyObject
impl From<AnyException> for AnyObject
Source§fn from(obj: AnyException) -> Self
fn from(obj: AnyException) -> Self
Source§impl<R: Rosy> From<RosyObject<R>> for AnyObject
impl<R: Rosy> From<RosyObject<R>> for AnyObject
Source§fn from(obj: RosyObject<R>) -> Self
fn from(obj: RosyObject<R>) -> Self
Source§impl Object for AnyObject
impl Object for AnyObject
Source§fn unique_id() -> Option<u128>
fn unique_id() -> Option<u128>
Source§unsafe fn from_raw(raw: usize) -> Self
unsafe fn from_raw(raw: usize) -> Self
raw without checking. Read moreSource§fn cast<A: Object>(obj: A) -> Option<Self>
fn cast<A: Object>(obj: A) -> Option<Self>
obj. Read moreSource§fn as_any_object(&self) -> &Self
fn as_any_object(&self) -> &Self
self as an AnyObject.Source§fn into_any_object(self) -> Self
fn into_any_object(self) -> Self
self as an AnyObject.Source§unsafe fn cast_unchecked(obj: impl Object) -> Self
unsafe fn cast_unchecked(obj: impl Object) -> Self
obj to Self without checking its type.Source§fn as_any_slice(&self) -> &[AnyObject]
fn as_any_slice(&self) -> &[AnyObject]
self as a reference to a single-element slice.Source§unsafe fn as_unchecked<O: Object>(&self) -> &O
unsafe fn as_unchecked<O: Object>(&self) -> &O
self to O without checking whether it is one.Source§unsafe fn into_unchecked<O: Object>(self) -> O
unsafe fn into_unchecked<O: Object>(self) -> O
self to O without checking whether it is one.Source§fn singleton_class(self) -> Class<Self>
fn singleton_class(self) -> Class<Self>
Source§unsafe fn force_recycle(self)
unsafe fn force_recycle(self)
self. Read moreSource§fn def_singleton_method<N, F>(self, name: N, f: F) -> Result
fn def_singleton_method<N, F>(self, name: N, f: F) -> Result
name on the singleton class of self that calls
f when invoked.Source§unsafe fn def_singleton_method_unchecked<N, F>(self, name: N, f: F)
unsafe fn def_singleton_method_unchecked<N, F>(self, name: N, f: F)
Source§unsafe fn call_with_protected(
self,
method: impl Into<SymbolId>,
args: &[impl Object],
) -> Result<AnyObject>
unsafe fn call_with_protected( self, method: impl Into<SymbolId>, args: &[impl Object], ) -> Result<AnyObject>
Source§unsafe fn call_public_with(
self,
method: impl Into<SymbolId>,
args: &[impl Object],
) -> AnyObject
unsafe fn call_public_with( self, method: impl Into<SymbolId>, args: &[impl Object], ) -> AnyObject
Source§unsafe fn call_public_with_protected(
self,
method: impl Into<SymbolId>,
args: &[impl Object],
) -> Result<AnyObject>
unsafe fn call_public_with_protected( self, method: impl Into<SymbolId>, args: &[impl Object], ) -> Result<AnyObject>
method on self with args and returns its output,
or an exception if one is raised. Read moreSource§fn is_eql<O: Object>(self, other: &O) -> bool
fn is_eql<O: Object>(self, other: &O) -> bool
self is equal to other in terms of the eql?
method.Source§fn get_attr<N: Into<SymbolId>>(self, name: N) -> AnyObject
fn get_attr<N: Into<SymbolId>>(self, name: N) -> AnyObject
self associated with name.