[][src]Struct artichoke_backend::value::Value

pub struct Value(_);

Boxed Ruby value in the Artichoke interpreter.

Implementations

impl Value[src]

#[must_use]pub fn new() -> Self[src]

Create a new, empty Ruby value.

Alias for Value::default.

#[must_use]pub fn nil() -> Self[src]

Create a nil Ruby Value.

#[must_use]pub fn inner(&self) -> mrb_value[src]

The sys::mrb_value that this Value wraps.

#[must_use]pub fn ruby_type(&self) -> Ruby[src]

Return this values Rust-mapped type tag.

#[must_use]pub fn pretty_name<'a>(&self, interp: &mut Artichoke) -> &'a str[src]

#[must_use]pub fn is_unreachable(&self) -> bool[src]

Whether a value is an interpreter-only variant not exposed to Ruby.

Some type tags like MRB_TT_UNDEF are internal to the mruby VM and manipulating them with the sys API is unspecified and may result in a segfault.

After extracting a sys::mrb_value from the interpreter, check to see if the value is unreachable a Fatal exception.

See: mruby#4460.

#[must_use]pub fn is_dead(&self, interp: &mut Artichoke) -> bool[src]

Return whether this object is unreachable by any GC roots.

pub fn is_range(
    &self,
    interp: &mut Artichoke,
    len: Int
) -> Result<Option<Range>, Exception>
[src]

pub fn implicitly_convert_to_int(
    &self,
    interp: &mut Artichoke
) -> Result<Int, TypeError>
[src]

pub fn implicitly_convert_to_string(
    &mut self,
    interp: &mut Artichoke
) -> Result<&[u8], TypeError>
[src]

pub fn implicitly_convert_to_nilable_string(
    &mut self,
    interp: &mut Artichoke
) -> Result<Option<&[u8]>, TypeError>
[src]

Trait Implementations

impl Clone for Value[src]

impl Convert<Integer, Value> for Artichoke[src]

impl Convert<Option<Value>, Value> for Artichoke[src]

impl Convert<Option<i64>, Value> for Artichoke[src]

impl Convert<Value, Option<Value>> for Artichoke[src]

impl Convert<Value, Value> for Artichoke[src]

impl Convert<bool, Value> for Artichoke[src]

impl Convert<i16, Value> for Artichoke[src]

impl Convert<i32, Value> for Artichoke[src]

impl Convert<i64, Value> for Artichoke[src]

Converter for Artichoke native integer type.

The Int type alias must be i64.

assert_eq!(mem::size_of::<i64>(), mem::size_of::<Int>());
assert_eq!(i64::min_value(), Int::min_value());
assert_eq!(i64::max_value(), Int::max_value());
assert_eq!(TypeId::of::<i64>(), TypeId::of::<Int>());

impl Convert<i8, Value> for Artichoke[src]

impl Convert<u16, Value> for Artichoke[src]

impl Convert<u32, Value> for Artichoke[src]

impl Convert<u8, Value> for Artichoke[src]

impl<'_> ConvertMut<&'_ [u8], Value> for Artichoke[src]

impl<'_> ConvertMut<&'_ str, Value> for Artichoke[src]

impl<'a> ConvertMut<Cow<'a, [u8]>, Value> for Artichoke[src]

impl<'a> ConvertMut<Cow<'a, str>, Value> for Artichoke[src]

impl ConvertMut<Float, Value> for Artichoke[src]

impl ConvertMut<HashMap<Vec<u8>, Vec<u8>, RandomState>, Value> for Artichoke[src]

impl<'_> ConvertMut<Option<&'_ [u8]>, Value> for Artichoke[src]

impl<'_> ConvertMut<Option<&'_ str>, Value> for Artichoke[src]

impl ConvertMut<Option<HashMap<Vec<u8>, Option<Vec<u8>>, RandomState>>, Value> for Artichoke[src]

impl ConvertMut<Option<String>, Value> for Artichoke[src]

impl ConvertMut<Option<Vec<u8>>, Value> for Artichoke[src]

impl ConvertMut<Outcome, Value> for Artichoke[src]

impl ConvertMut<RandomNumber, Value> for Artichoke[src]

impl ConvertMut<RandomNumber, Value> for Artichoke[src]

impl ConvertMut<String, Value> for Artichoke[src]

impl ConvertMut<Value, Options> for Artichoke[src]

impl ConvertMut<Value, Value> for Artichoke[src]

impl ConvertMut<Vec<(Value, Value)>, Value> for Artichoke[src]

impl ConvertMut<Vec<u8>, Value> for Artichoke[src]

impl ConvertMut<f64, Value> for Artichoke[src]

impl Copy for Value[src]

impl Debug for Value[src]

impl Default for Value[src]

impl From<Option<Value>> for Value[src]

impl From<Option<mrb_value>> for Value[src]

impl From<Value> for NoBlockGiven[src]

impl From<mrb_value> for Value[src]

fn from(value: mrb_value) -> Self[src]

Construct a new Value from a sys::mrb_value.

impl FromIterator<Value> for Array[src]

impl PartialEq<Value> for Value[src]

impl TryConvert<Value, Float> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvert<Value, Integer> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvert<Value, Option<bool>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvert<Value, Option<i64>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvert<Value, bool> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvert<Value, f64> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvert<Value, i64> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvert<Value, u32> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvert<Value, usize> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvert<isize, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvert<u64, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvert<usize, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_, '_> TryConvertMut<&'_ [&'_ [u8]], Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_, '_> TryConvertMut<&'_ [&'_ str], Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_, '_> TryConvertMut<&'_ [Option<&'_ [u8]>], Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_, '_> TryConvertMut<&'_ [Option<&'_ str>], Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_> TryConvertMut<&'_ [Option<Value>], Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_> TryConvertMut<&'_ [Option<Vec<u8>>], Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_> TryConvertMut<&'_ [String], Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_> TryConvertMut<&'_ [Value], Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_> TryConvertMut<&'_ [Vec<u8>], Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_> TryConvertMut<&'_ [i64], Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_> TryConvertMut<&'_ OsStr, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'a> TryConvertMut<&'a mut Value, CaptureExtract<'a>> for Artichoke[src]

type Error = TypeError

Error type for failed conversions.

impl<'a> TryConvertMut<&'a mut Value, IntegerString<'a>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<CaptureMatch, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'a> TryConvertMut<Cow<'a, OsStr>, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<OsString, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'a> TryConvertMut<Value, &'a [u8]> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'a> TryConvertMut<Value, &'a str> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Value, Encoding> for Artichoke[src]

type Error = InvalidEncodingError

Error type for failed conversions.

impl<'a> TryConvertMut<Value, Option<&'a [u8]>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'a> TryConvertMut<Value, Option<&'a str>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Value, Option<String>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Value, Option<Vec<u8>>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Value, RandomNumberMax> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Value, RandomNumberMax> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Value, Seed> for Artichoke[src]

type Error = TypeError

Error type for failed conversions.

impl TryConvertMut<Value, String> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'a> TryConvertMut<Value, Vec<&'a [u8]>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'a> TryConvertMut<Value, Vec<&'a str>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Value, Vec<(Value, Value)>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'a> TryConvertMut<Value, Vec<Option<&'a [u8]>>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'a> TryConvertMut<Value, Vec<Option<&'a str>>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Value, Vec<Option<String>>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Value, Vec<Option<Vec<u8>>>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Value, Vec<String>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Value, Vec<Value>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Value, Vec<Vec<u8>>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Value, Vec<i64>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Value, Vec<u8>> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_> TryConvertMut<Vec<&'_ [u8]>, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_> TryConvertMut<Vec<&'_ str>, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Vec<(Vec<u8>, Vec<i64>)>, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_> TryConvertMut<Vec<Option<&'_ [u8]>>, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_> TryConvertMut<Vec<Option<&'_ str>>, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Vec<Option<Vec<u8>>>, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Vec<String>, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Vec<Value>, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_> TryConvertMut<Vec<Vec<Option<&'_ [u8]>>>, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl<'_> TryConvertMut<Vec<Vec<Option<&'_ str>>>, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Vec<Vec<Option<Vec<u8>>>>, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Vec<Vec<u8>>, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl TryConvertMut<Vec<i64>, Value> for Artichoke[src]

type Error = Exception

Error type for failed conversions.

impl Value for Value[src]

type Artichoke = Artichoke

Concrete type for Artichoke interpreter.

type Arg = Self

Concrete type for arguments passed to funcall.

type Value = Self

Concrete type for results from funcall.

type Block = Self

Concrete type for blocks passed to funcall.

type Error = Exception

Concrete error type for funcall errors.

Auto Trait Implementations

impl RefUnwindSafe for Value

impl !Send for Value

impl !Sync for Value

impl Unpin for Value

impl UnwindSafe for Value

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]