pub struct Request<'a> {
pub jsonrpc: TwoPointZero,
pub id: Id<'a>,
pub method: Cow<'a, str>,
pub params: Option<Cow<'a, RawValue>>,
}Expand description
Re-export types from jsonrpsee_types crate for convenience.
JSON-RPC request object as defined in the spec.
Fields§
§jsonrpc: TwoPointZeroJSON-RPC version.
id: Id<'a>Request ID
method: Cow<'a, str>Name of the method to be invoked.
params: Option<Cow<'a, RawValue>>Parameter values of the request.
Decoding borrows them from the input, so a request with params only decodes from borrowed
input such as serde_json::from_str or serde_json::from_slice.
Implementations§
Source§impl<'a> Request<'a>
impl<'a> Request<'a>
Sourcepub fn borrowed(
method: &'a str,
params: Option<&'a RawValue>,
id: Id<'a>,
) -> Request<'a>
pub fn borrowed( method: &'a str, params: Option<&'a RawValue>, id: Id<'a>, ) -> Request<'a>
Create new borrowed Request.
Sourcepub fn owned(
method: String,
params: Option<Box<RawValue>>,
id: Id<'a>,
) -> Request<'a>
pub fn owned( method: String, params: Option<Box<RawValue>>, id: Id<'a>, ) -> Request<'a>
Create new owned Request.
Sourcepub fn method_name(&self) -> &str
pub fn method_name(&self) -> &str
Get the method name of the request.
Trait Implementations§
Source§impl<'de, 'a> Deserialize<'de> for Request<'a>where
'de: 'a,
impl<'de, 'a> Deserialize<'de> for Request<'a>where
'de: 'a,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Request<'a>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Request<'a>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> Serialize for Request<'a>
impl<'a> Serialize for Request<'a>
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl<'a> Forget for Request<'a>
impl<'a> Freeze for Request<'a>
impl<'a> Move for Request<'a>
impl<'a> RefUnwindSafe for Request<'a>
impl<'a> Send for Request<'a>
impl<'a> Sync for Request<'a>
impl<'a> Unpin for Request<'a>
impl<'a> UnsafeUnpin for Request<'a>
impl<'a> UnwindSafe for Request<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn 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>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 72 bytes