pub struct RosyObject<R> { /* private fields */ }Expand description
An instance of a Ruby object that wraps around Rust data.
See the documentation for Rosy for more information.
Implementations§
Trait Implementations§
Source§impl<R> Clone for RosyObject<R>
impl<R> Clone for RosyObject<R>
Source§impl<R: Rosy> Debug for RosyObject<R>
impl<R: Rosy> Debug for RosyObject<R>
Source§impl<R: Rosy> Display for RosyObject<R>
impl<R: Rosy> Display for RosyObject<R>
Source§impl<R: Rosy> From<R> for RosyObject<R>
impl<R: Rosy> From<R> for RosyObject<R>
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
Converts to this type from the input type.
Source§impl<R: Rosy> Object for RosyObject<R>
impl<R: Rosy> Object for RosyObject<R>
Source§fn unique_id() -> Option<u128>
fn unique_id() -> Option<u128>
Returns a unique identifier for an object type to facilitate casting. Read more
Source§fn cast<A: Object>(obj: A) -> Option<Self>
fn cast<A: Object>(obj: A) -> Option<Self>
Attempts to create an instance by casting
obj. Read moreSource§unsafe fn from_raw(raw: usize) -> Self
unsafe fn from_raw(raw: usize) -> Self
Creates a new object from
raw without checking. Read moreSource§unsafe fn cast_unchecked(obj: impl Object) -> Self
unsafe fn cast_unchecked(obj: impl Object) -> Self
Casts
obj to Self without checking its type.Source§fn into_any_object(self) -> AnyObject
fn into_any_object(self) -> AnyObject
Returns
self as an AnyObject.Source§fn as_any_object(&self) -> &AnyObject
fn as_any_object(&self) -> &AnyObject
Returns a reference to
self as an AnyObject.Source§fn as_any_slice(&self) -> &[AnyObject]
fn as_any_slice(&self) -> &[AnyObject]
Returns
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
Casts
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
Converts
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)
Forces the garbage collector to free the contents of
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
Defines a method for
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>
Calls the public
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
Returns whether
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
Returns the value for the attribute of
self associated with name.impl<R> Copy for RosyObject<R>
Auto Trait Implementations§
impl<R> Freeze for RosyObject<R>
impl<R> RefUnwindSafe for RosyObject<R>where
R: RefUnwindSafe,
impl<R> !Send for RosyObject<R>
impl<R> !Sync for RosyObject<R>
impl<R> Unpin for RosyObject<R>where
R: Unpin,
impl<R> UnwindSafe for RosyObject<R>where
R: UnwindSafe,
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