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
Available on crate feature anyhow only.
impl UnsafeToValue for &Error
Available on crate feature
anyhow only.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
Available on crate feature anyhow only.
impl UnsafeToValue for &mut Error
Available on crate feature
anyhow only.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.