rune::runtime

Trait UnsafeToRef

Source
pub trait UnsafeToRef {
    type Guard: 'static;

    // Required method
    unsafe fn unsafe_to_ref<'a>(
        value: Value,
    ) -> Result<(&'a Self, Self::Guard), RuntimeError>;
}
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, ) -> Result<(&'a Self, Self::Guard), RuntimeError>

§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 = RawValueGuard

Source§

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

Source§

impl UnsafeToRef for Result<Value, Value>

Source§

type Guard = RawValueGuard

Source§

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

Source§

impl UnsafeToRef for str

Source§

type Guard = RawAnyGuard

Source§

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

Source§

impl UnsafeToRef for Error

Source§

type Guard = RawValueGuard

Source§

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

Source§

impl UnsafeToRef for ParseCharError

Source§

type Guard = RawValueGuard

Source§

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

Source§

impl UnsafeToRef for Error

Source§

type Guard = RawValueGuard

Source§

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

Source§

impl UnsafeToRef for ParseFloatError

Source§

type Guard = RawValueGuard

Source§

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

Source§

impl UnsafeToRef for ParseIntError

Source§

type Guard = RawValueGuard

Source§

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

Source§

impl UnsafeToRef for Utf8Error

Source§

type Guard = RawValueGuard

Source§

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

Source§

impl UnsafeToRef for Error

Available on crate feature std only.
Source§

type Guard = RawValueGuard

Source§

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

Source§

impl UnsafeToRef for [u8]

Source§

type Guard = RawAnyGuard

Source§

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

Source§

impl UnsafeToRef for [Value]

Source§

type Guard = RawAnyGuard

Source§

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

Implementors§

Source§

impl UnsafeToRef for ControlFlow

Source§

impl UnsafeToRef for GeneratorState

Source§

impl UnsafeToRef for FromUtf8Error

Available on crate feature alloc only.
Source§

impl UnsafeToRef for String

Source§

impl UnsafeToRef for Bencher

Source§

impl UnsafeToRef for Format

Source§

impl UnsafeToRef for Bytes

Source§

impl UnsafeToRef for Formatter

Source§

impl UnsafeToRef for Function

Source§

impl UnsafeToRef for Future

Source§

impl UnsafeToRef for Generator<Vm>

Source§

impl UnsafeToRef for Hasher

Source§

impl UnsafeToRef for Object

Source§

impl UnsafeToRef for OwnedTuple

Source§

impl UnsafeToRef for Range

Source§

impl UnsafeToRef for RangeFrom

Source§

impl UnsafeToRef for RangeFull

Source§

impl UnsafeToRef for RangeInclusive

Source§

impl UnsafeToRef for RangeTo

Source§

impl UnsafeToRef for RangeToInclusive

Source§

impl UnsafeToRef for Stream<Vm>

Source§

impl UnsafeToRef for Tuple

Source§

impl UnsafeToRef for Vec