[][src]Trait stk::UnsafeFromValue

pub trait UnsafeFromValue: Sized {
    type Guard;
    unsafe fn unsafe_from_value(
        value: ValuePtr,
        vm: &mut Vm
    ) -> Result<(Self, Self::Guard), StackError>; }

A potentially unsafe conversion for value conversion.

Associated Types

type Guard

The raw guard returned.

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

Loading content...

Required methods

unsafe fn unsafe_from_value(
    value: ValuePtr,
    vm: &mut Vm
) -> Result<(Self, Self::Guard), StackError>

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.

Loading content...

Implementations on Foreign Types

impl<'a> UnsafeFromValue for &'a [u8][src]

type Guard = RawRefGuard

impl<'a> UnsafeFromValue for &'a str[src]

type Guard = RawRefGuard

impl<'a> UnsafeFromValue for &'a String[src]

type Guard = RawRefGuard

impl<'a> UnsafeFromValue for &'a mut String[src]

type Guard = RawMutGuard

Loading content...

Implementors

impl<'a> UnsafeFromValue for &'a Bytes[src]

type Guard = RawRefGuard

impl<'a> UnsafeFromValue for &'a Array<ValuePtr>[src]

type Guard = RawRefGuard

impl<'a> UnsafeFromValue for &'a Object<ValuePtr>[src]

type Guard = RawRefGuard

impl<'a> UnsafeFromValue for &'a mut Bytes[src]

type Guard = RawMutGuard

impl<T> UnsafeFromValue for T where
    T: FromValue
[src]

type Guard = ()

Loading content...