Struct Request
pub struct Request<'a> {
pub jsonrpc: TwoPointZero,
pub id: Id<'a>,
pub method: Cow<'a, str>,
pub params: Option<Cow<'a, RawValue>>,
}server only.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§
§impl<'a> Request<'a>
impl<'a> Request<'a>
pub 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.
pub 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.
pub fn id(&self) -> Id<'a>
pub fn id(&self) -> Id<'a>
Get the ID of the request.
pub fn method_name(&self) -> &str
pub fn method_name(&self) -> &str
Get the method name of the request.
pub fn params(&self) -> Params<'_>
pub fn params(&self) -> Params<'_>
Get the params of the request.
Trait Implementations§
§impl<'de, 'a> Deserialize<'de> for Request<'a>where
'de: 'a,
impl<'de, 'a> Deserialize<'de> for Request<'a>where
'de: 'a,
§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>,
§impl<'a> Serialize for Request<'a>
impl<'a> Serialize for Request<'a>
§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,
Auto Trait Implementations§
impl<'a> Freeze 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
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> ⓘ
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