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.
Implementations on Foreign Types§
source§impl<'a> FromValue<'a> for i32
impl<'a> FromValue<'a> for i32
type Checker = GenericValueTypeChecker<i32>
unsafe fn from_value(value: &'a Value) -> Self
source§impl<'a> FromValue<'a> for u64
impl<'a> FromValue<'a> for u64
type Checker = GenericValueTypeChecker<u64>
unsafe fn from_value(value: &'a Value) -> Self
source§impl<'a> FromValue<'a> for &'a str
impl<'a> FromValue<'a> for &'a str
type Checker = GenericValueTypeOrNoneChecker<&'a str>
unsafe fn from_value(value: &'a Value) -> Self
source§impl<'a> FromValue<'a> for u8
impl<'a> FromValue<'a> for u8
type Checker = GenericValueTypeChecker<u8>
unsafe fn from_value(value: &'a Value) -> Self
source§impl<'a> FromValue<'a> for i8
impl<'a> FromValue<'a> for i8
type Checker = GenericValueTypeChecker<i8>
unsafe fn from_value(value: &'a Value) -> Self
source§impl<'a> FromValue<'a> for i64
impl<'a> FromValue<'a> for i64
type Checker = GenericValueTypeChecker<i64>
unsafe fn from_value(value: &'a Value) -> Self
source§impl<'a> FromValue<'a> for String
impl<'a> FromValue<'a> for String
type Checker = GenericValueTypeOrNoneChecker<String>
unsafe fn from_value(value: &'a Value) -> Self
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,
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.