Struct artichoke_backend::convert::UnboxedValueGuard[][src]

pub struct UnboxedValueGuard<'a, T> { /* fields omitted */ }

Implementations

Construct a new guard around the given T.

UnboxedValueGuard allows passing around a &mut reference without dropping the T when returning control to mruby C code. This is desirable because the T is owned by the mruby heap until the mruby garbage collector frees the mrb_value that holds it.

Get a shared reference to the inner T.

Get a unique reference to the inner T.

Take the inner T out of the guard.

Safety

Callers must ensure that T is not dropped. Once T is taken out of the guard, it must ultimately be passed to ManuallyDrop before it is dropped.

An example of safe usage is calling taking an Array out of the guard and then immediately calling Array::into_raw_parts on the returned value.

Trait Implementations

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

The resulting type after dereferencing.

Dereferences the value.

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Mutably dereferences the value.

Mutably dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.