pub unsafe trait FromValue<'a>: Sized {
type Checker: ValueTypeChecker;
// Required method
unsafe fn from_value(value: &'a Value) -> Self;
}Expand description
Required Associated Types§
Sourcetype Checker: ValueTypeChecker
type Checker: ValueTypeChecker
Value type checker.
Required Methods§
Sourceunsafe fn from_value(value: &'a Value) -> Self
unsafe fn from_value(value: &'a Value) -> Self
Get the contained value from a Value.
§Safety
Self::Checker::check() must be called first and must not fail.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<'a, T, C, E> FromValue<'a> for Option<T>where
T: FromValue<'a, Checker = C> + StaticType,
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>,
E: Error + Send + Sized + 'static,
Blanket implementation for all optional types.
impl<'a, T, C, E> FromValue<'a> for Option<T>where
T: FromValue<'a, Checker = C> + StaticType,
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>,
E: Error + Send + Sized + 'static,
Blanket implementation for all optional types.