Struct jsonrpsee_types::params::Params
source · [−]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
sourceimpl<'a> Params<'a>
impl<'a> Params<'a>
sourcepub fn sequence(&self) -> ParamsSequence<'_>
pub fn sequence(&self) -> ParamsSequence<'_>
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.
sourcepub fn parse<T>(&'a self) -> Result<T, CallError> where
T: Deserialize<'a>,
pub fn parse<T>(&'a self) -> Result<T, CallError> where
T: Deserialize<'a>,
Attempt to parse all parameters as an array or map into type T
.
sourcepub fn one<T>(&'a self) -> Result<T, CallError> where
T: Deserialize<'a>,
pub fn one<T>(&'a self) -> Result<T, CallError> where
T: Deserialize<'a>,
Attempt to parse parameters as an array of a single value of type T
, and returns that value.
sourcepub fn into_owned(self) -> Params<'static>
pub fn into_owned(self) -> Params<'static>
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
Auto Trait Implementations
impl<'a> RefUnwindSafe for Params<'a>
impl<'a> Send for Params<'a>
impl<'a> Sync for Params<'a>
impl<'a> Unpin for Params<'a>
impl<'a> UnwindSafe for Params<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more