[−][src]Struct rosy::object::AnyObject
An instance of any Ruby object.
Methods
impl AnyObject[src]
pub fn convert_slice(objects: &[impl Object]) -> &[AnyObject][src]
Casts the concrete slice objects into a slice of AnyObject.
pub fn call_super() -> Result<AnyObject>[src]
Calls super on the current receiver without any arguments in the
context of a method.
pub unsafe fn call_super_unchecked() -> AnyObject[src]
Calls super on the current receiver without any arguments in the
context of a method, without checking for an exception.
pub fn call_super_with(args: &[impl Object]) -> Result<AnyObject>[src]
Calls super on the current receiver with args in the context of a
method.
pub unsafe fn call_super_with_unchecked(args: &[impl Object]) -> AnyObject[src]
Calls super on the current receiver with args in the context of a
method, without checking for an exception.
pub const unsafe fn from_raw(raw: usize) -> AnyObject[src]
An alternative to
Object::from_raw that works in a
const context.
pub const fn nil() -> AnyObject[src]
Returns a nil instance.
pub const fn from_bool(b: bool) -> AnyObject[src]
Returns an instance from a boolean.
pub fn is_nil(self) -> bool[src]
Returns whether self is nil.
pub fn is_undefined(self) -> bool[src]
Returns whether self is undefined.
pub fn is_true(self) -> bool[src]
Returns whether self is true.
pub fn is_false(self) -> bool[src]
Returns whether self is false.
pub fn to_bool(self) -> Option<bool>[src]
Returns the boolean value for self, if any.
pub fn is_fixnum(self) -> bool[src]
Returns whether self is a fixed-sized number.
pub fn is_bignum(self) -> bool[src]
Returns whether self is a variable-sized number.
pub fn is_integer(self) -> bool[src]
Returns whether self is a fixed-sized number.
pub fn to_integer(self) -> Option<Integer>[src]
Returns self as an Integer if it is one.
pub fn is_float(self) -> bool[src]
Returns whether self is a floating point number type.
pub fn is_string(self) -> bool[src]
Returns whether self is a String.
pub fn to_string(self) -> Option<String>[src]
Returns self as a String if it is one.
pub fn is_symbol(self) -> bool[src]
Returns whether self is a Symbol.
pub fn to_symbol(self) -> Option<Symbol>[src]
Returns self as a Symbol if it is one.
pub fn is_array(self) -> bool[src]
Returns whether self is an Array.
pub fn to_array(self) -> Option<Array>[src]
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.
pub fn is_class(self) -> bool[src]
Returns whether self is a Class.
pub fn to_class(self) -> Option<Class>[src]
Returns self as a Class if it is one.
pub fn is_module(self) -> bool[src]
Returns whether self is a Module.
pub fn to_module(self) -> Option<Module>[src]
Returns self as a Module if it is one.
pub fn is_exception(self) -> bool[src]
Returns whether self is an Exception.
pub fn to_exception(self) -> Option<AnyException>[src]
Returns self as an AnyException if it is one.
Trait Implementations
impl Object for AnyObject[src]
fn unique_id() -> Option<u128>[src]
unsafe fn from_raw(raw: usize) -> Self[src]
fn cast<A: Object>(obj: A) -> Option<Self>[src]
fn ty(self) -> Ty[src]
fn raw(self) -> usize[src]
fn as_any_object(&self) -> &Self[src]
fn into_any_object(self) -> Self[src]
unsafe fn cast_unchecked(obj: impl Object) -> Self[src]
Casts obj to Self without checking its type.
fn as_any_slice(&self) -> &[AnyObject][src]
Returns self as a reference to a single-element slice.
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 is_ty(self, ty: Ty) -> bool[src]
Returns whether the virtual type of self is ty.
fn class(self) -> Class[src]
Returns the Class for self.
fn singleton_class(self) -> Class[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, [src]
N: Into<SymbolId>,
F: MethodFn,
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, [src]
N: Into<SymbolId>,
F: MethodFn,
Defines a method for name on the singleton class of self that calls f when invoked. Read more
fn call(self, method: impl Into<SymbolId>) -> Result<AnyObject>[src]
Calls method on self and returns the result.
unsafe fn call_unchecked(self, method: impl Into<SymbolId>) -> AnyObject[src]
Calls method on self and returns the result. Read more
fn call_with(
self,
method: impl Into<SymbolId>,
args: &[impl Object]
) -> Result<AnyObject>[src]
self,
method: impl Into<SymbolId>,
args: &[impl Object]
) -> Result<AnyObject>
Calls method on self with args and returns the result.
unsafe fn call_with_unchecked(
self,
method: impl Into<SymbolId>,
args: &[impl Object]
) -> AnyObject[src]
self,
method: impl Into<SymbolId>,
args: &[impl Object]
) -> AnyObject
Calls method on self with args and returns the result. Read more
fn call_public(self, method: impl Into<SymbolId>) -> Result<AnyObject>[src]
Calls the public method on self and returns the result.
unsafe fn call_public_unchecked(self, method: impl Into<SymbolId>) -> AnyObject[src]
Calls the public method on self and returns the result. Read more
fn call_public_with(
self,
method: impl Into<SymbolId>,
args: &[impl Object]
) -> Result<AnyObject>[src]
self,
method: impl Into<SymbolId>,
args: &[impl Object]
) -> Result<AnyObject>
Calls the public method on self with args and returns the result.
unsafe fn call_public_with_unchecked(
self,
method: impl Into<SymbolId>,
args: &[impl Object]
) -> AnyObject[src]
self,
method: impl Into<SymbolId>,
args: &[impl Object]
) -> AnyObject
Calls the public method on self with args and returns the result. 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
impl<O: Object> AsRef<AnyObject> for Array<O>[src]
impl AsRef<AnyObject> for AnyException[src]
impl<K: Object, V: Object> AsRef<AnyObject> for Hash<K, V>[src]
impl AsRef<AnyObject> for Integer[src]
impl AsRef<AnyObject> for Class[src]
impl AsRef<AnyObject> for Module[src]
impl AsRef<AnyObject> for AnyObject[src]
impl<R: Rosy> AsRef<AnyObject> for RosyObject<R>[src]
impl AsRef<AnyObject> for Encoding[src]
impl AsRef<AnyObject> for String[src]
impl AsRef<AnyObject> for Symbol[src]
impl AsRef<AnyObject> for InstrSeq[src]
impl Clone for AnyObject[src]
fn clone(&self) -> AnyObject[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<O: Object> From<Array<O>> for AnyObject[src]
impl From<AnyException> for AnyObject[src]
fn from(obj: AnyException) -> Self[src]
impl<K: Object, V: Object> From<Hash<K, V>> for AnyObject[src]
impl From<Integer> for AnyObject[src]
impl From<usize> for AnyObject[src]
impl From<u128> for AnyObject[src]
impl From<u64> for AnyObject[src]
impl From<u32> for AnyObject[src]
impl From<u16> for AnyObject[src]
impl From<u8> for AnyObject[src]
impl From<isize> for AnyObject[src]
impl From<i128> for AnyObject[src]
impl From<i64> for AnyObject[src]
impl From<i32> for AnyObject[src]
impl From<i16> for AnyObject[src]
impl From<i8> for AnyObject[src]
impl From<Class> for AnyObject[src]
impl From<Module> for AnyObject[src]
impl<O: Into<AnyObject>> From<Option<O>> for AnyObject[src]
impl<O: Into<AnyObject>, E: Into<AnyObject>> From<Result<O, E>> for AnyObject[src]
impl From<f32> for AnyObject[src]
impl From<f64> for AnyObject[src]
impl From<bool> for AnyObject[src]
impl<R: Rosy> From<RosyObject<R>> for AnyObject[src]
fn from(obj: RosyObject<R>) -> Self[src]
impl From<Encoding> for AnyObject[src]
impl From<String> for AnyObject[src]
impl<'_> From<&'_ str> for AnyObject[src]
impl<'_> From<&'_ String> for AnyObject[src]
impl<'_> From<&'_ [u8]> for AnyObject[src]
impl<'_> From<&'_ Vec<u8>> for AnyObject[src]
impl<'_> From<&'_ CStr> for AnyObject[src]
impl<'_> From<&'_ CString> for AnyObject[src]
impl From<Symbol> for AnyObject[src]
impl From<InstrSeq> for AnyObject[src]
impl Eq for AnyObject[src]
impl Copy for AnyObject[src]
impl<O: Object> PartialEq<AnyObject> for Array<O>[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<K: Object, V: Object> PartialEq<AnyObject> for Hash<K, V>[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<O: Object> PartialEq<O> for AnyObject[src]
fn eq(&self, other: &O) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<[u8]> for AnyObject[src]
fn eq(&self, other: &[u8]) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'_> PartialEq<&'_ [u8]> for AnyObject[src]
fn eq(&self, other: &&[u8]) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<AnyObject> for [u8][src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'_> PartialEq<AnyObject> for &'_ [u8][src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<Vec<u8>> for AnyObject[src]
fn eq(&self, other: &Vec<u8>) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'_> PartialEq<&'_ Vec<u8>> for AnyObject[src]
fn eq(&self, other: &&Vec<u8>) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<AnyObject> for Vec<u8>[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'_> PartialEq<AnyObject> for &'_ Vec<u8>[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<str> for AnyObject[src]
fn eq(&self, other: &str) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'_> PartialEq<&'_ str> for AnyObject[src]
fn eq(&self, other: &&str) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<AnyObject> for str[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'_> PartialEq<AnyObject> for &'_ str[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<String> for AnyObject[src]
fn eq(&self, other: &String) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'_> PartialEq<&'_ String> for AnyObject[src]
fn eq(&self, other: &&String) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<AnyObject> for String[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'_> PartialEq<AnyObject> for &'_ String[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<CStr> for AnyObject[src]
fn eq(&self, other: &CStr) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'_> PartialEq<&'_ CStr> for AnyObject[src]
fn eq(&self, other: &&CStr) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<AnyObject> for CStr[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'_> PartialEq<AnyObject> for &'_ CStr[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<CString> for AnyObject[src]
fn eq(&self, other: &CString) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'_> PartialEq<&'_ CString> for AnyObject[src]
fn eq(&self, other: &&CString) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<AnyObject> for CString[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'_> PartialEq<AnyObject> for &'_ CString[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<bool> for AnyObject[src]
fn eq(&self, other: &bool) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'_> PartialEq<&'_ bool> for AnyObject[src]
fn eq(&self, other: &&bool) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<AnyObject> for bool[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'_> PartialEq<AnyObject> for &'_ bool[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<R: Rosy> PartialEq<AnyObject> for RosyObject<R>[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<AnyObject> for Encoding[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<AnyObject> for Symbol[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl PartialEq<AnyObject> for InstrSeq[src]
fn eq(&self, obj: &AnyObject) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl Debug for AnyObject[src]
impl Display for AnyObject[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
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.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,