Trait UnsafeToRef

Source
pub trait UnsafeToRef {
    type Guard: 'static;

    // Required method
    unsafe fn unsafe_to_ref<'a>(
        value: Value,
    ) -> VmResult<(&'a Self, Self::Guard)>;
}
Expand description

Unsafe to ref coercion.

Required Associated Types§

Source

type Guard: 'static

The raw guard returned.

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

Required Methods§

Source

unsafe fn unsafe_to_ref<'a>(value: Value) -> VmResult<(&'a Self, Self::Guard)>

§Safety

Caller must ensure that the returned reference does not outlive the guard.

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.

Implementations on Foreign Types§

Source§

impl UnsafeToRef for Option<Value>

Source§

type Guard = RawRef

Source§

unsafe fn unsafe_to_ref<'a>(value: Value) -> VmResult<(&'a Self, Self::Guard)>

Source§

impl UnsafeToRef for Result<Value, Value>

Source§

type Guard = RawRef

Source§

unsafe fn unsafe_to_ref<'a>(value: Value) -> VmResult<(&'a Self, Self::Guard)>

Source§

impl UnsafeToRef for str

Source§

type Guard = RawRef

Source§

unsafe fn unsafe_to_ref<'a>(value: Value) -> VmResult<(&'a Self, Self::Guard)>

Source§

impl UnsafeToRef for ParseCharError

Source§

type Guard = RawRef

Source§

unsafe fn unsafe_to_ref<'a>(value: Value) -> VmResult<(&'a Self, Self::Guard)>

Source§

impl UnsafeToRef for Error

Source§

type Guard = RawRef

Source§

unsafe fn unsafe_to_ref<'a>(value: Value) -> VmResult<(&'a Self, Self::Guard)>

Source§

impl UnsafeToRef for ParseFloatError

Source§

type Guard = RawRef

Source§

unsafe fn unsafe_to_ref<'a>(value: Value) -> VmResult<(&'a Self, Self::Guard)>

Source§

impl UnsafeToRef for ParseIntError

Source§

type Guard = RawRef

Source§

unsafe fn unsafe_to_ref<'a>(value: Value) -> VmResult<(&'a Self, Self::Guard)>

Source§

impl UnsafeToRef for Utf8Error

Source§

type Guard = RawRef

Source§

unsafe fn unsafe_to_ref<'a>(value: Value) -> VmResult<(&'a Self, Self::Guard)>

Source§

impl UnsafeToRef for Error

Source§

type Guard = RawRef

Source§

unsafe fn unsafe_to_ref<'a>(value: Value) -> VmResult<(&'a Self, Self::Guard)>

Source§

impl UnsafeToRef for Error

Source§

type Guard = RawRef

Source§

unsafe fn unsafe_to_ref<'a>(value: Value) -> VmResult<(&'a Self, Self::Guard)>

Source§

impl UnsafeToRef for [Value]

Source§

type Guard = RawRef

Source§

unsafe fn unsafe_to_ref<'a>(value: Value) -> VmResult<(&'a Self, Self::Guard)>

Source§

impl UnsafeToRef for [u8]

Source§

type Guard = RawRef

Source§

unsafe fn unsafe_to_ref<'a>(value: Value) -> VmResult<(&'a Self, Self::Guard)>

Implementors§