Trait dxr::TryFromParams
source · pub trait TryFromParams: Sized {
// Required method
fn try_from_params(values: &[Value]) -> Result<Self, DxrError>;
}
Expand description
Trait for converting from XML-RPC method call argument lists to Rust values.
Required Methods§
sourcefn try_from_params(values: &[Value]) -> Result<Self, DxrError>
fn try_from_params(values: &[Value]) -> Result<Self, DxrError>
Fallible conversion method from XML-RPC method call argument lists to Rust values.
The conversion aims to do the “expected” thing, depending on the input XML-RPC value type and the targeted Rust type.
- Tuples with N members of potentially heterogeneous types are converted from lists with length N. This returns an error if the lengths don’t match, or if any of the target types don’t match.
- Simple values are treated the same as singletons / one-tuples, i.e. this returns an error if the length of the parameter list is not one.
- Lists of homogeneously typed values are not checked for length, but only converted to the target type. This returns an error if any list value does not match the target type.
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl TryFromParams for bool
impl TryFromParams for bool
source§impl TryFromParams for f64
impl TryFromParams for f64
source§impl TryFromParams for i32
impl TryFromParams for i32
source§impl TryFromParams for i64
Available on crate feature i8
only.
impl TryFromParams for i64
Available on crate feature
i8
only.source§impl TryFromParams for ()
impl TryFromParams for ()
source§impl TryFromParams for String
impl TryFromParams for String
source§impl TryFromParams for Vec<u8>
impl TryFromParams for Vec<u8>
source§impl TryFromParams for NaiveDateTime
impl TryFromParams for NaiveDateTime
source§impl<A, B> TryFromParams for (A, B)where
A: TryFromValue,
B: TryFromValue,
impl<A, B> TryFromParams for (A, B)where
A: TryFromValue,
B: TryFromValue,
source§impl<A, B, C> TryFromParams for (A, B, C)
impl<A, B, C> TryFromParams for (A, B, C)
source§impl<A, B, C, D> TryFromParams for (A, B, C, D)
impl<A, B, C, D> TryFromParams for (A, B, C, D)
source§impl<A, B, C, D, E> TryFromParams for (A, B, C, D, E)
impl<A, B, C, D, E> TryFromParams for (A, B, C, D, E)
source§impl<A, B, C, D, E, F> TryFromParams for (A, B, C, D, E, F)where
A: TryFromValue,
B: TryFromValue,
C: TryFromValue,
D: TryFromValue,
E: TryFromValue,
F: TryFromValue,
impl<A, B, C, D, E, F> TryFromParams for (A, B, C, D, E, F)where
A: TryFromValue,
B: TryFromValue,
C: TryFromValue,
D: TryFromValue,
E: TryFromValue,
F: TryFromValue,
source§impl<A, B, C, D, E, F, G> TryFromParams for (A, B, C, D, E, F, G)where
A: TryFromValue,
B: TryFromValue,
C: TryFromValue,
D: TryFromValue,
E: TryFromValue,
F: TryFromValue,
G: TryFromValue,
impl<A, B, C, D, E, F, G> TryFromParams for (A, B, C, D, E, F, G)where
A: TryFromValue,
B: TryFromValue,
C: TryFromValue,
D: TryFromValue,
E: TryFromValue,
F: TryFromValue,
G: TryFromValue,
source§impl<A, B, C, D, E, F, G, H> TryFromParams for (A, B, C, D, E, F, G, H)where
A: TryFromValue,
B: TryFromValue,
C: TryFromValue,
D: TryFromValue,
E: TryFromValue,
F: TryFromValue,
G: TryFromValue,
H: TryFromValue,
impl<A, B, C, D, E, F, G, H> TryFromParams for (A, B, C, D, E, F, G, H)where
A: TryFromValue,
B: TryFromValue,
C: TryFromValue,
D: TryFromValue,
E: TryFromValue,
F: TryFromValue,
G: TryFromValue,
H: TryFromValue,
source§impl<T> TryFromParams for Option<T>where
T: TryFromValue,
Available on crate feature nil
only.
impl<T> TryFromParams for Option<T>where
T: TryFromValue,
Available on crate feature
nil
only.