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§
Sourcefn from_value(
ctx: &FromValueContext<'a>,
value: &'a Value,
) -> Result<Self, FromValueError>
fn from_value( ctx: &FromValueContext<'a>, value: &'a Value, ) -> Result<Self, FromValueError>
Create this type from the given value from the ValueArena
.
§Arguments
ctx
: The value extraction context.handle
: The handle that points to the value to convert.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.