pub trait IntoParams: DeserializeOwned + Send {
// Provided method
fn into_params(value: Option<Value>) -> Result<Self> { ... }
}
Expand description
IntoParams
allows for converting an Option<Value>
into
the necessary type for RPC handler parameters.
The default implementation below will result in failure if the value is None
.
For customized behavior, users can implement their own into_params
method.
Provided Methods§
fn into_params(value: Option<Value>) -> Result<Self>
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§
impl IntoParams for Value
This is the IntoRpcParams implementation for serde_json Value.
Note: As above, this might not be a capability app code might want to allow for rpc_handlers, prefering to have everything strongly type.
Source§impl<D> IntoParams for Option<D>
Implements IntoRpcParams
for any type that also implements IntoRpcParams
.
impl<D> IntoParams for Option<D>
Implements IntoRpcParams
for any type that also implements IntoRpcParams
.
Note: Application code might prefer to avoid this blanket implementation.