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§

source

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

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl TryFromParams for f64

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl TryFromParams for i32

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl TryFromParams for i64

Available on crate feature i8 only.
source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl TryFromParams for ()

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl TryFromParams for String

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl TryFromParams for Vec<u8>

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl TryFromParams for NaiveDateTime

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl<A, B> TryFromParams for (A, B)

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl<A, B, C> TryFromParams for (A, B, C)

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl<A, B, C, D> TryFromParams for (A, B, C, D)

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl<A, B, C, D, E> TryFromParams for (A, B, C, D, E)

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl<A, B, C, D, E, F> TryFromParams for (A, B, C, D, E, F)

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl<A, B, C, D, E, F, G> TryFromParams for (A, B, C, D, E, F, G)

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl<A, B, C, D, E, F, G, H> TryFromParams for (A, B, C, D, E, F, G, H)

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl<T> TryFromParams for Option<T>
where T: TryFromValue,

Available on crate feature nil only.
source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl<T> TryFromParams for (T,)
where T: TryFromValue,

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl<T> TryFromParams for Vec<T>
where T: TryFromValue,

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

source§

impl<T> TryFromParams for HashMap<String, T>
where T: TryFromValue,

source§

fn try_from_params(values: &[Value]) -> Result<Self, DxrError>

Implementors§