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§
Required Methods§
Sourceunsafe fn unsafe_to_ref<'a>(
value: Value,
) -> Result<(&'a Self, Self::Guard), RuntimeError>
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>
impl UnsafeToRef for Option<Value>
type Guard = RawValueGuard
unsafe fn unsafe_to_ref<'a>( value: Value, ) -> Result<(&'a Self, Self::Guard), RuntimeError>
Source§impl UnsafeToRef for Result<Value, Value>
impl UnsafeToRef for Result<Value, Value>
type Guard = RawValueGuard
unsafe fn unsafe_to_ref<'a>( value: Value, ) -> Result<(&'a Self, Self::Guard), RuntimeError>
Source§impl UnsafeToRef for str
impl UnsafeToRef for str
type Guard = RawAnyGuard
unsafe fn unsafe_to_ref<'a>( value: Value, ) -> Result<(&'a Self, Self::Guard), RuntimeError>
Source§impl UnsafeToRef for Error
impl UnsafeToRef for Error
type Guard = RawValueGuard
unsafe fn unsafe_to_ref<'a>( value: Value, ) -> Result<(&'a Self, Self::Guard), RuntimeError>
Source§impl UnsafeToRef for ParseCharError
impl UnsafeToRef for ParseCharError
type Guard = RawValueGuard
unsafe fn unsafe_to_ref<'a>( value: Value, ) -> Result<(&'a Self, Self::Guard), RuntimeError>
Source§impl UnsafeToRef for Error
impl UnsafeToRef for Error
type Guard = RawValueGuard
unsafe fn unsafe_to_ref<'a>( value: Value, ) -> Result<(&'a Self, Self::Guard), RuntimeError>
Source§impl UnsafeToRef for ParseFloatError
impl UnsafeToRef for ParseFloatError
type Guard = RawValueGuard
unsafe fn unsafe_to_ref<'a>( value: Value, ) -> Result<(&'a Self, Self::Guard), RuntimeError>
Source§impl UnsafeToRef for ParseIntError
impl UnsafeToRef for ParseIntError
type Guard = RawValueGuard
unsafe fn unsafe_to_ref<'a>( value: Value, ) -> Result<(&'a Self, Self::Guard), RuntimeError>
Source§impl UnsafeToRef for Utf8Error
impl UnsafeToRef for Utf8Error
type Guard = RawValueGuard
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.
impl UnsafeToRef for Error
Available on crate feature
std
only.type Guard = RawValueGuard
unsafe fn unsafe_to_ref<'a>( value: Value, ) -> Result<(&'a Self, Self::Guard), RuntimeError>
Source§impl UnsafeToRef for [u8]
impl UnsafeToRef for [u8]
type Guard = RawAnyGuard
unsafe fn unsafe_to_ref<'a>( value: Value, ) -> Result<(&'a Self, Self::Guard), RuntimeError>
Source§impl UnsafeToRef for [Value]
impl UnsafeToRef for [Value]
type Guard = RawAnyGuard
unsafe fn unsafe_to_ref<'a>( value: Value, ) -> Result<(&'a Self, Self::Guard), RuntimeError>
Implementors§
Source§impl UnsafeToRef for ControlFlow
impl UnsafeToRef for ControlFlow
type Guard = RawValueGuard
Source§impl UnsafeToRef for GeneratorState
impl UnsafeToRef for GeneratorState
type Guard = RawValueGuard
Source§impl UnsafeToRef for FromUtf8Error
Available on crate feature alloc
only.
impl UnsafeToRef for FromUtf8Error
Available on crate feature
alloc
only.