pub struct Params<'a>(_);
Expand description

Parameters sent with an incoming JSON-RPC request.

The data containing the params is a Cow<&str> and can either be a borrowed &str of JSON from an incoming super::request::Request (which in turn borrows it from the input buffer that is shared between requests); or, it can be an owned String.

Implementations

Create params

Returns true if the contained JSON is an object

Obtain a sequence parser, ParamsSequence.

This allows sequential parsing of the incoming params, using an Iterator-style API and is useful when the RPC request has optional parameters at the tail that may or may not be present.

Attempt to parse all parameters as an array or map into type T.

Attempt to parse parameters as an array of a single value of type T, and returns that value.

Convert Params<'a> to Params<'static> so that it can be moved across threads.

This will cause an allocation if the params internally are using a borrowed JSON slice.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more