[−][src]Trait artichoke_backend::extn::prelude::Value
A boxed Ruby value owned by the interpreter.
Value
is equivalent to an RValue
in MRI or mrb_value
in mruby.
Associated Types
type Artichoke
[src]
Concrete type for Artichoke interpreter.
type Arg
[src]
Concrete type for arguments passed to funcall
.
type Value: Value
[src]
Concrete type for results from funcall
.
type Block
[src]
Concrete type for blocks passed to funcall
.
type Error
[src]
Concrete error type for funcall errors.
Required methods
pub fn funcall(
&self,
interp: &mut Self::Artichoke,
func: &str,
args: &[Self::Arg],
block: Option<Self::Block>
) -> Result<Self::Value, Self::Error>
[src]
&self,
interp: &mut Self::Artichoke,
func: &str,
args: &[Self::Arg],
block: Option<Self::Block>
) -> Result<Self::Value, Self::Error>
Call a method on this Value
with arguments and an optional block.
Errors
If an exception is raised on the interpreter, then an error is returned.
If a TryConvert
conversion fails, then an error is returned.
pub fn freeze(
&mut self,
interp: &mut Self::Artichoke
) -> Result<(), Self::Error>
[src]
&mut self,
interp: &mut Self::Artichoke
) -> Result<(), Self::Error>
Call #freeze
on this Value
.
Errors
If an exception is raised on the interpreter, then an error is returned.
pub fn is_frozen(&self, interp: &mut Self::Artichoke) -> bool
[src]
Call #frozen?
on this Value
.
pub fn is_nil(&self) -> bool
[src]
Whether self
is nil
pub fn respond_to(
&self,
interp: &mut Self::Artichoke,
method: &str
) -> Result<bool, Self::Error>
[src]
&self,
interp: &mut Self::Artichoke,
method: &str
) -> Result<bool, Self::Error>
Whether self
responds to a method.
Equivalent to invoking #respond_to?
on this Value
.
Errors
If an exception is raised on the interpreter, then an error is returned.
pub fn inspect(&self, interp: &mut Self::Artichoke) -> Vec<u8, Global>
[src]
Call #inspect
on this Value
.
This function can never fail.
pub fn to_s(&self, interp: &mut Self::Artichoke) -> Vec<u8, Global>
[src]
Call #to_s
on this Value
.
This function can never fail.
pub fn ruby_type(&self) -> Ruby
[src]
Return this values Rust-mapped type tag.
Provided methods
pub fn try_into<T>(self, interp: &Self::Artichoke) -> Result<T, Self::Error> where
Self::Artichoke: TryConvert<Self, T>,
<Self::Artichoke as TryConvert<Self, T>>::Error == Self::Error,
[src]
Self::Artichoke: TryConvert<Self, T>,
<Self::Artichoke as TryConvert<Self, T>>::Error == Self::Error,
Consume self
and try to convert self
to type T
using a
TryConvert
conversion.
Errors
If a TryConvert
conversion fails, then an error is returned.
pub fn try_into_mut<T>(
self,
interp: &mut Self::Artichoke
) -> Result<T, Self::Error> where
Self::Artichoke: TryConvertMut<Self, T>,
<Self::Artichoke as TryConvertMut<Self, T>>::Error == Self::Error,
[src]
self,
interp: &mut Self::Artichoke
) -> Result<T, Self::Error> where
Self::Artichoke: TryConvertMut<Self, T>,
<Self::Artichoke as TryConvertMut<Self, T>>::Error == Self::Error,
Consume self
and try to convert self
to type T
using a
TryConvertMut
conversion.
Errors
If a TryConvertMut
conversion fails, then an error is returned.
Implementors
impl Value for Value
[src]
type Artichoke = Artichoke
type Arg = Self
type Value = Self
type Block = Self
type Error = Error
pub fn funcall(
&self,
interp: &mut Self::Artichoke,
func: &str,
args: &[Self::Arg],
block: Option<Self::Block>
) -> Result<Self::Value, Self::Error>
[src]
&self,
interp: &mut Self::Artichoke,
func: &str,
args: &[Self::Arg],
block: Option<Self::Block>
) -> Result<Self::Value, Self::Error>
pub fn freeze(
&mut self,
interp: &mut Self::Artichoke
) -> Result<(), Self::Error>
[src]
&mut self,
interp: &mut Self::Artichoke
) -> Result<(), Self::Error>
pub fn is_frozen(&self, interp: &mut Self::Artichoke) -> bool
[src]
pub fn inspect(&self, interp: &mut Self::Artichoke) -> Vec<u8>
[src]
pub fn is_nil(&self) -> bool
[src]
pub fn respond_to(
&self,
interp: &mut Self::Artichoke,
method: &str
) -> Result<bool, Self::Error>
[src]
&self,
interp: &mut Self::Artichoke,
method: &str
) -> Result<bool, Self::Error>