Trait ruby_marshal::FromValue

source ·
pub trait FromValue<'a>: Sized {
    // Required method
    fn from_value(
        ctx: &FromValueContext<'a>,
        value: &'a Value,
    ) -> Result<Self, FromValueError>;
}
Expand description

Implemented for any type that can be created from a Ruby Value.

Required Methods§

source

fn from_value( ctx: &FromValueContext<'a>, value: &'a Value, ) -> Result<Self, FromValueError>

Create this type from the given value from the ValueArena.

§Arguments
  1. ctx: The value extraction context.
  2. handle: The handle that points to the value to convert.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a> FromValue<'a> for bool

source§

fn from_value( ctx: &FromValueContext<'a>, value: &'a Value, ) -> Result<Self, FromValueError>

source§

impl<'a> FromValue<'a> for i32

source§

fn from_value( ctx: &FromValueContext<'a>, value: &'a Value, ) -> Result<Self, FromValueError>

source§

impl<'a, K, V> FromValue<'a> for BTreeMap<K, V>
where K: FromValue<'a> + Eq + Ord, V: FromValue<'a>,

source§

fn from_value( ctx: &FromValueContext<'a>, value: &'a Value, ) -> Result<Self, FromValueError>

source§

impl<'a, K, V> FromValue<'a> for HashMap<K, V>
where K: FromValue<'a> + Hash + Eq, V: FromValue<'a>,

source§

fn from_value( ctx: &FromValueContext<'a>, value: &'a Value, ) -> Result<Self, FromValueError>

source§

impl<'a, T> FromValue<'a> for Option<T>
where T: FromValue<'a>,

source§

fn from_value( ctx: &FromValueContext<'a>, value: &'a Value, ) -> Result<Self, FromValueError>

source§

impl<'a, T> FromValue<'a> for Vec<T>
where T: FromValue<'a>,

source§

fn from_value( ctx: &FromValueContext<'a>, value: &'a Value, ) -> Result<Self, FromValueError>

Implementors§

source§

impl<'a> FromValue<'a> for &'a Value

source§

impl<'a> FromValue<'a> for &'a ArrayValue

source§

impl<'a> FromValue<'a> for &'a BoolValue

source§

impl<'a> FromValue<'a> for &'a FixnumValue

source§

impl<'a> FromValue<'a> for &'a HashValue

source§

impl<'a> FromValue<'a> for &'a NilValue

source§

impl<'a> FromValue<'a> for &'a ObjectValue

source§

impl<'a> FromValue<'a> for &'a StringValue

source§

impl<'a> FromValue<'a> for &'a SymbolValue

source§

impl<'a> FromValue<'a> for &'a UserDefinedValue