Trait artichoke_backend::convert::BoxUnboxVmValue

source ·
pub trait BoxUnboxVmValue {
    type Unboxed;
    type Guarded;

    const RUBY_TYPE: &'static str;

    // Required methods
    unsafe fn unbox_from_value<'a>(
        value: &'a mut Value,
        interp: &mut Artichoke
    ) -> Result<UnboxedValueGuard<'a, Self::Guarded>, Error>;
    fn alloc_value(
        value: Self::Unboxed,
        interp: &mut Artichoke
    ) -> Result<Value, Error>;
    fn box_into_value(
        value: Self::Unboxed,
        into: Value,
        interp: &mut Artichoke
    ) -> Result<Value, Error>;
    fn free(data: *mut c_void);
}

Required Associated Types§

Required Associated Constants§

source

const RUBY_TYPE: &'static str

Required Methods§

source

unsafe fn unbox_from_value<'a>( value: &'a mut Value, interp: &mut Artichoke ) -> Result<UnboxedValueGuard<'a, Self::Guarded>, Error>

§Safety

Implementations may return owned values. These values must not outlive the underlying mrb_value, which may be garbage collected by mruby.

The values returned by this method should not be stored for more than the current FFI trampoline entry point.

source

fn alloc_value( value: Self::Unboxed, interp: &mut Artichoke ) -> Result<Value, Error>

source

fn box_into_value( value: Self::Unboxed, into: Value, interp: &mut Artichoke ) -> Result<Value, Error>

source

fn free(data: *mut c_void)

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl BoxUnboxVmValue for String

§

type Unboxed = String

§

type Guarded = String

source§

const RUBY_TYPE: &'static str = "String"

source§

unsafe fn unbox_from_value<'a>( value: &'a mut Value, interp: &mut Artichoke ) -> Result<UnboxedValueGuard<'a, Self::Guarded>, Error>

source§

fn alloc_value( value: Self::Unboxed, interp: &mut Artichoke ) -> Result<Value, Error>

source§

fn box_into_value( value: Self::Unboxed, into: Value, interp: &mut Artichoke ) -> Result<Value, Error>

source§

fn free(data: *mut c_void)

source§

impl BoxUnboxVmValue for Symbol

§

type Unboxed = Symbol

§

type Guarded = Immediate<<Symbol as BoxUnboxVmValue>::Unboxed>

source§

const RUBY_TYPE: &'static str = "Symbol"

source§

unsafe fn unbox_from_value<'a>( value: &'a mut Value, interp: &mut Artichoke ) -> Result<UnboxedValueGuard<'a, Self::Guarded>, Error>

source§

fn alloc_value( value: Self::Unboxed, interp: &mut Artichoke ) -> Result<Value, Error>

source§

fn box_into_value( value: Self::Unboxed, into: Value, interp: &mut Artichoke ) -> Result<Value, Error>

source§

fn free(data: *mut c_void)

Implementors§

source§

impl<T> BoxUnboxVmValue for T
where T: HeapAllocatedData + Sized + 'static,

§

type Unboxed = T

§

type Guarded = HeapAllocated<<T as BoxUnboxVmValue>::Unboxed>

source§

const RUBY_TYPE: &'static str = <Self as HeapAllocatedData>::RUBY_TYPE