Trait forest_filecoin::rpc::reflect::Params

source ·
pub trait Params<const ARITY: usize>: HasLotusJson {
    // Required methods
    fn schemas(gen: &mut SchemaGenerator) -> [(Schema, bool); ARITY];
    fn parse(
        raw: Option<RequestParameters>,
        names: [&str; ARITY],
        calling_convention: ParamStructure,
        n_required: usize,
    ) -> Result<Self, Error>
       where Self: Sized;

    // Provided method
    fn unparse(self) -> Result<[Value; ARITY], Error> { ... }
}
Expand description

A tuple of ARITY arguments.

This should NOT be manually implemented.

Required Methods§

source

fn schemas(gen: &mut SchemaGenerator) -> [(Schema, bool); ARITY]

A Schema and Optional::optional schema-nullable pair for argument, in-order.

source

fn parse( raw: Option<RequestParameters>, names: [&str; ARITY], calling_convention: ParamStructure, n_required: usize, ) -> Result<Self, Error>
where Self: Sized,

Convert from raw request parameters, to the argument tuple required by RpcMethod::handle

Provided Methods§

source

fn unparse(self) -> Result<[Value; ARITY], Error>

Convert from an argument tuple to un-typed JSON.

Exposes de-serialization errors, or mis-implementation of this trait.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Params<0> for ()

source§

fn parse( raw: Option<RequestParameters>, arg_names: [&str; 0], calling_convention: ParamStructure, n_required: usize, ) -> Result<Self, Error>

source§

fn schemas(_gen: &mut SchemaGenerator) -> [(Schema, bool); 0]

source§

impl<T0> Params<1> for (T0,)

source§

fn parse( raw: Option<RequestParameters>, arg_names: [&str; 1], calling_convention: ParamStructure, n_required: usize, ) -> Result<Self, Error>

source§

fn schemas(_gen: &mut SchemaGenerator) -> [(Schema, bool); 1]

source§

impl<T0, T1> Params<2> for (T0, T1)

source§

fn parse( raw: Option<RequestParameters>, arg_names: [&str; 2], calling_convention: ParamStructure, n_required: usize, ) -> Result<Self, Error>

source§

fn schemas(_gen: &mut SchemaGenerator) -> [(Schema, bool); 2]

source§

impl<T0, T1, T2> Params<3> for (T0, T1, T2)

source§

fn parse( raw: Option<RequestParameters>, arg_names: [&str; 3], calling_convention: ParamStructure, n_required: usize, ) -> Result<Self, Error>

source§

fn schemas(_gen: &mut SchemaGenerator) -> [(Schema, bool); 3]

source§

impl<T0, T1, T2, T3> Params<4> for (T0, T1, T2, T3)

source§

fn parse( raw: Option<RequestParameters>, arg_names: [&str; 4], calling_convention: ParamStructure, n_required: usize, ) -> Result<Self, Error>

source§

fn schemas(_gen: &mut SchemaGenerator) -> [(Schema, bool); 4]

Implementors§