Trait runestick::UnsafeFromValue[][src]

pub trait UnsafeFromValue: Sized {
    type Output: 'static;
    type Guard: 'static;
    fn from_value(value: Value) -> Result<(Self::Output, Self::Guard), VmError>;
unsafe fn unsafe_coerce(output: Self::Output) -> Self; }
Expand description

A potentially unsafe conversion for value conversion.

This trait is used to convert values to references, which can be safely used while an external function call is used. That sort of use is safe because we hold onto the guard returned by the conversion during external function calls.

Associated Types

The output type from the unsafe coercion.

The raw guard returned.

Must only be dropped after the value returned from this function is no longer live.

Required methods

Convert the given reference using unsafe assumptions to a value.

Safety

The return value of this function may only be used while a virtual machine is not being modified.

You must also make sure that the returned value does not outlive the guard.

Coerce the output of an unsafe from value into the final output type.

Safety

The return value of this function may only be used while a virtual machine is not being modified.

You must also make sure that the returned value does not outlive the guard.

Implementations on Foreign Types

Implementors