pub trait Params: Sized {
// Required methods
fn params() -> Vec<ParamInfo>;
fn take_from(
kind: &str,
m: &mut Map<String, Json>,
params: &[ParamInfo],
) -> Result<Self>;
// Provided method
fn parse(kind: &str, v: Json) -> Result<Self> { ... }
}Expand description
The parameters of a block, declared with block_params!.
Required Methods§
Sourcefn take_from(
kind: &str,
m: &mut Map<String, Json>,
params: &[ParamInfo],
) -> Result<Self>
fn take_from( kind: &str, m: &mut Map<String, Json>, params: &[ParamInfo], ) -> Result<Self>
Take the parameters from the mapping m of a block whose parameters are params
(these among them): the parser of a group of parameters shared by several blocks
(a [flatten] field of block_params!), whose unknown names
mapping rejected against the parameters of the whole block.
§Errors
As Params::parse.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".