pub trait UnsafeToValue: Sized {
type Guard: 'static;
// Required method
unsafe fn unsafe_to_value(
self,
) -> Result<(Value, Self::Guard), RuntimeError>;
}
Expand description
Trait for converting types into values.
Required Associated Types§
Required Methods§
Sourceunsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Convert into a value.
§Safety
The value returned must not be used after the guard associated with it has been dropped.
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 UnsafeToValue for &Option<Value>
impl UnsafeToValue for &Option<Value>
type Guard = ValueRefGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &Result<Value, Value>
impl UnsafeToValue for &Result<Value, Value>
type Guard = ValueRefGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &Error
impl UnsafeToValue for &Error
type Guard = ValueRefGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &ParseCharError
impl UnsafeToValue for &ParseCharError
type Guard = ValueRefGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &Error
impl UnsafeToValue for &Error
type Guard = ValueRefGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &ParseFloatError
impl UnsafeToValue for &ParseFloatError
type Guard = ValueRefGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &ParseIntError
impl UnsafeToValue for &ParseIntError
type Guard = ValueRefGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &Utf8Error
impl UnsafeToValue for &Utf8Error
type Guard = ValueRefGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &Error
Available on crate feature std
only.
impl UnsafeToValue for &Error
Available on crate feature
std
only.type Guard = ValueRefGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &mut Option<Value>
impl UnsafeToValue for &mut Option<Value>
type Guard = ValueMutGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &mut Result<Value, Value>
impl UnsafeToValue for &mut Result<Value, Value>
type Guard = ValueMutGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &mut Error
impl UnsafeToValue for &mut Error
type Guard = ValueMutGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &mut ParseCharError
impl UnsafeToValue for &mut ParseCharError
type Guard = ValueMutGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &mut Error
impl UnsafeToValue for &mut Error
type Guard = ValueMutGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &mut ParseFloatError
impl UnsafeToValue for &mut ParseFloatError
type Guard = ValueMutGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &mut ParseIntError
impl UnsafeToValue for &mut ParseIntError
type Guard = ValueMutGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &mut Utf8Error
impl UnsafeToValue for &mut Utf8Error
type Guard = ValueMutGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Source§impl UnsafeToValue for &mut Error
Available on crate feature std
only.
impl UnsafeToValue for &mut Error
Available on crate feature
std
only.type Guard = ValueMutGuard
unsafe fn unsafe_to_value(self) -> Result<(Value, Self::Guard), RuntimeError>
Implementors§
Source§impl UnsafeToValue for &ControlFlow
impl UnsafeToValue for &ControlFlow
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &GeneratorState
impl UnsafeToValue for &GeneratorState
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &FromUtf8Error
Available on crate feature alloc
only.
impl UnsafeToValue for &FromUtf8Error
Available on crate feature
alloc
only.type Guard = ValueRefGuard
Source§impl UnsafeToValue for &String
impl UnsafeToValue for &String
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &Bencher
impl UnsafeToValue for &Bencher
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &Format
impl UnsafeToValue for &Format
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &Bytes
impl UnsafeToValue for &Bytes
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &Formatter
impl UnsafeToValue for &Formatter
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &Function
impl UnsafeToValue for &Function
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &Future
impl UnsafeToValue for &Future
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &Generator<Vm>
impl UnsafeToValue for &Generator<Vm>
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &Hasher
impl UnsafeToValue for &Hasher
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &Object
impl UnsafeToValue for &Object
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &OwnedTuple
impl UnsafeToValue for &OwnedTuple
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &Range
impl UnsafeToValue for &Range
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &RangeFrom
impl UnsafeToValue for &RangeFrom
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &RangeFull
impl UnsafeToValue for &RangeFull
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &RangeInclusive
impl UnsafeToValue for &RangeInclusive
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &RangeTo
impl UnsafeToValue for &RangeTo
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &RangeToInclusive
impl UnsafeToValue for &RangeToInclusive
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &Stream<Vm>
impl UnsafeToValue for &Stream<Vm>
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &Vec
impl UnsafeToValue for &Vec
type Guard = ValueRefGuard
Source§impl UnsafeToValue for &mut ControlFlow
impl UnsafeToValue for &mut ControlFlow
type Guard = ValueMutGuard
Source§impl UnsafeToValue for &mut GeneratorState
impl UnsafeToValue for &mut GeneratorState
type Guard = ValueMutGuard
Source§impl UnsafeToValue for &mut FromUtf8Error
Available on crate feature alloc
only.
impl UnsafeToValue for &mut FromUtf8Error
Available on crate feature
alloc
only.