pub struct Value(/* private fields */);
Expand description
Ruby’s VALUE
type, which can represent any Ruby object.
Methods for Value
are implemented on the ReprValue
trait, which is
also implemented for all Ruby types.
Trait Implementations§
source§impl FromRawValue for Value
Available on crate feature rb-sys
only.
impl FromRawValue for Value
Available on crate feature
rb-sys
only.source§impl ReprValue for Value
impl ReprValue for Value
source§fn equal<T>(self, other: T) -> Result<bool, Error>where
T: ReprValue,
fn equal<T>(self, other: T) -> Result<bool, Error>where
T: ReprValue,
Checks for equality, delegating to the Ruby method
#==
. Read moresource§fn eql<T>(self, other: T) -> Result<bool, Error>where
T: ReprValue,
fn eql<T>(self, other: T) -> Result<bool, Error>where
T: ReprValue,
Checks for equality, delegating to the Ruby method
#eql?
. Read moresource§fn hash(self) -> Result<Integer, Error>
fn hash(self) -> Result<Integer, Error>
Returns an integer non-uniquely identifying
self
. Read moresource§fn to_bool(self) -> bool
fn to_bool(self) -> bool
Convert
self
to a bool
, following Ruby’s rules of false
and nil
as boolean false
and everything else boolean true
. Read moresource§fn funcall_public<M, A, T>(self, method: M, args: A) -> Result<T, Error>
fn funcall_public<M, A, T>(self, method: M, args: A) -> Result<T, Error>
source§fn block_call<M, A, R, T>(
self,
method: M,
args: A,
block: fn(_: &[Value], _: Option<Proc>) -> R
) -> Result<T, Error>
fn block_call<M, A, R, T>( self, method: M, args: A, block: fn(_: &[Value], _: Option<Proc>) -> R ) -> Result<T, Error>
source§fn respond_to<M>(self, method: M, include_private: bool) -> Result<bool, Error>where
M: IntoId,
fn respond_to<M>(self, method: M, include_private: bool) -> Result<bool, Error>where
M: IntoId,
Check if
self
responds to the given Ruby method. Read moresource§fn is_kind_of<T>(self, class: T) -> bool
fn is_kind_of<T>(self, class: T) -> bool
source§fn enumeratorize<M, A>(self, method: M, args: A) -> Enumerator ⓘwhere
M: IntoSymbol,
A: ArgList,
fn enumeratorize<M, A>(self, method: M, args: A) -> Enumerator ⓘwhere
M: IntoSymbol,
A: ArgList,
source§impl TryConvert for Value
impl TryConvert for Value
impl Copy for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations§
source§impl<T> AsRawValue for Twhere
T: ReprValue,
impl<T> AsRawValue for Twhere
T: ReprValue,
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