pub trait FromInputValue<S = DefaultScalarValue>: Sized {
type Error;
// Required method
fn from_input_value(v: &InputValue<S>) -> Result<Self, Self::Error>;
// Provided method
fn from_implicit_null() -> Result<Self, Self::Error> { ... }
}Expand description
Parsing of an unstructured InputValue into a Rust data type.
The conversion can fail, and must in that case return an Err. Thus, not restricted in the
definition of this trait, the returned Err should be convertible with the IntoFieldError
trait to fit well into the library machinery.
Required Associated Types§
Sourcetype Error
type Error
Type of this conversion error.
Thus, not restricted, it should be convertible with the IntoFieldError trait to fit well
into the library machinery.
Required Methods§
Sourcefn from_input_value(v: &InputValue<S>) -> Result<Self, Self::Error>
fn from_input_value(v: &InputValue<S>) -> Result<Self, Self::Error>
Performs the conversion.
Provided Methods§
Sourcefn from_implicit_null() -> Result<Self, Self::Error>
fn from_implicit_null() -> Result<Self, Self::Error>
Performs the conversion from an absent value (e.g. to distinguish
between implicit and explicit null).
The default implementation just calls from_input_value() as if an
explicit null was provided.
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<S, T: FromInputValue<S>> FromInputValue<S> for Option<T>
impl<S, T: FromInputValue<S>> FromInputValue<S> for Option<T>
type Error = <T as FromInputValue<S>>::Error
fn from_input_value(v: &InputValue<S>) -> Result<Self, Self::Error>
Source§impl<S: ScalarValue, T: FromInputValue<S>> FromInputValue<S> for Vec<T>
impl<S: ScalarValue, T: FromInputValue<S>> FromInputValue<S> for Vec<T>
type Error = FromInputValueVecError<T, S>
fn from_input_value(v: &InputValue<S>) -> Result<Self, Self::Error>
Source§impl<T, S> FromInputValue<S> for Box<T>where
S: ScalarValue,
T: FromInputValue<S>,
impl<T, S> FromInputValue<S> for Box<T>where
S: ScalarValue,
T: FromInputValue<S>,
type Error = <T as FromInputValue<S>>::Error
fn from_input_value(v: &InputValue<S>) -> Result<Box<T>, Self::Error>
Source§impl<T, S> FromInputValue<S> for Arc<T>where
S: ScalarValue,
T: FromInputValue<S>,
impl<T, S> FromInputValue<S> for Arc<T>where
S: ScalarValue,
T: FromInputValue<S>,
type Error = <T as FromInputValue<S>>::Error
fn from_input_value(v: &InputValue<S>) -> Result<Arc<T>, Self::Error>
Source§impl<T, S, const N: usize> FromInputValue<S> for [T; N]where
T: FromInputValue<S>,
S: ScalarValue,
impl<T, S, const N: usize> FromInputValue<S> for [T; N]where
T: FromInputValue<S>,
S: ScalarValue,
type Error = FromInputValueArrayError<T, S>
fn from_input_value(v: &InputValue<S>) -> Result<Self, Self::Error>
Source§impl<Tz, __S> FromInputValue<__S> for DateTime<Tz>
Available on crate feature chrono only.
impl<Tz, __S> FromInputValue<__S> for DateTime<Tz>
chrono only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for Tzwhere
__S: ScalarValue,
Available on crate feature chrono-tz only.
impl<__S> FromInputValue<__S> for Tzwhere
__S: ScalarValue,
chrono-tz only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for boolwhere
__S: ScalarValue,
impl<__S> FromInputValue<__S> for boolwhere
__S: ScalarValue,
type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for f64where
__S: ScalarValue,
impl<__S> FromInputValue<__S> for f64where
__S: ScalarValue,
type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for i32where
__S: ScalarValue,
impl<__S> FromInputValue<__S> for i32where
__S: ScalarValue,
type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for Stringwhere
__S: ScalarValue,
impl<__S> FromInputValue<__S> for Stringwhere
__S: ScalarValue,
type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for BigDecimalwhere
__S: ScalarValue,
Available on crate feature bigdecimal only.
impl<__S> FromInputValue<__S> for BigDecimalwhere
__S: ScalarValue,
bigdecimal only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for DateTimewhere
__S: ScalarValue,
Available on crate feature bson only.
impl<__S> FromInputValue<__S> for DateTimewhere
__S: ScalarValue,
bson only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for ObjectIdwhere
__S: ScalarValue,
Available on crate feature bson only.
impl<__S> FromInputValue<__S> for ObjectIdwhere
__S: ScalarValue,
bson only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for NaiveDatewhere
__S: ScalarValue,
Available on crate feature chrono only.
impl<__S> FromInputValue<__S> for NaiveDatewhere
__S: ScalarValue,
chrono only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for NaiveDateTimewhere
__S: ScalarValue,
Available on crate feature chrono only.
impl<__S> FromInputValue<__S> for NaiveDateTimewhere
__S: ScalarValue,
chrono only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for NaiveTimewhere
__S: ScalarValue,
Available on crate feature chrono only.
impl<__S> FromInputValue<__S> for NaiveTimewhere
__S: ScalarValue,
chrono only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for CompactStringwhere
__S: ScalarValue,
impl<__S> FromInputValue<__S> for CompactStringwhere
__S: ScalarValue,
type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for Datewhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> FromInputValue<__S> for Datewhere
__S: ScalarValue,
jiff only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for DateTimewhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> FromInputValue<__S> for DateTimewhere
__S: ScalarValue,
jiff only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for Timewhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> FromInputValue<__S> for Timewhere
__S: ScalarValue,
jiff only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for Spanwhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> FromInputValue<__S> for Spanwhere
__S: ScalarValue,
jiff only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for Timestampwhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> FromInputValue<__S> for Timestampwhere
__S: ScalarValue,
jiff only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for Offsetwhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> FromInputValue<__S> for Offsetwhere
__S: ScalarValue,
jiff only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for TimeZonewhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> FromInputValue<__S> for TimeZonewhere
__S: ScalarValue,
jiff only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for Zonedwhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> FromInputValue<__S> for Zonedwhere
__S: ScalarValue,
jiff only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for Decimalwhere
__S: ScalarValue,
Available on crate feature rust_decimal only.
impl<__S> FromInputValue<__S> for Decimalwhere
__S: ScalarValue,
rust_decimal only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for Datewhere
__S: ScalarValue,
Available on crate feature time only.
impl<__S> FromInputValue<__S> for Datewhere
__S: ScalarValue,
time only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for OffsetDateTimewhere
__S: ScalarValue,
Available on crate feature time only.
impl<__S> FromInputValue<__S> for OffsetDateTimewhere
__S: ScalarValue,
time only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for PrimitiveDateTimewhere
__S: ScalarValue,
Available on crate feature time only.
impl<__S> FromInputValue<__S> for PrimitiveDateTimewhere
__S: ScalarValue,
time only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for Timewhere
__S: ScalarValue,
Available on crate feature time only.
impl<__S> FromInputValue<__S> for Timewhere
__S: ScalarValue,
time only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for UtcOffsetwhere
__S: ScalarValue,
Available on crate feature time only.
impl<__S> FromInputValue<__S> for UtcOffsetwhere
__S: ScalarValue,
time only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for Urlwhere
__S: ScalarValue,
Available on crate feature url only.
impl<__S> FromInputValue<__S> for Urlwhere
__S: ScalarValue,
url only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Source§impl<__S> FromInputValue<__S> for Uuidwhere
__S: ScalarValue,
Available on crate feature uuid only.
impl<__S> FromInputValue<__S> for Uuidwhere
__S: ScalarValue,
uuid only.type Error = FieldError<__S>
fn from_input_value(input: &InputValue<__S>) -> Result<Self, Self::Error>
Implementors§
Source§impl<S, T: FromInputValue<S>> FromInputValue<S> for Nullable<T>
impl<S, T: FromInputValue<S>> FromInputValue<S> for Nullable<T>
type Error = <T as FromInputValue<S>>::Error
Source§impl<__S> FromInputValue<__S> for TypeKindwhere
__S: ScalarValue,
impl<__S> FromInputValue<__S> for TypeKindwhere
__S: ScalarValue,
Source§impl<__S> FromInputValue<__S> for Episodewhere
__S: ScalarValue,
Available on crate feature expose-test-schema only.
impl<__S> FromInputValue<__S> for Episodewhere
__S: ScalarValue,
expose-test-schema only.Source§impl<__S> FromInputValue<__S> for juniper::integrations::jiff::TimeZonewhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> FromInputValue<__S> for juniper::integrations::jiff::TimeZonewhere
__S: ScalarValue,
jiff only.