pub struct Request<'a> {
pub jsonrpc: TwoPointZero,
pub id: Id<'a>,
pub method: Cow<'a, str>,
pub params: Option<Cow<'a, RawValue>>,
pub extensions: Extensions,
}
Expand description
JSON-RPC request object as defined in the spec.
Fields§
§jsonrpc: TwoPointZero
JSON-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.
extensions: Extensions
The request’s extensions.
Implementations§
source§impl<'a> Request<'a>
impl<'a> Request<'a>
sourcepub fn new(
method: Cow<'a, str>,
params: Option<&'a RawValue>,
id: Id<'a>,
) -> Self
pub fn new( method: Cow<'a, str>, params: Option<&'a RawValue>, id: Id<'a>, ) -> Self
Create a new Request
.
sourcepub fn method_name(&self) -> &str
pub fn method_name(&self) -> &str
Get the method name of the request.
sourcepub fn extensions(&self) -> &Extensions
pub fn extensions(&self) -> &Extensions
Returns a reference to the associated extensions.
sourcepub fn extensions_mut(&mut self) -> &mut Extensions
pub fn extensions_mut(&mut self) -> &mut Extensions
Returns a reference to the associated extensions.
Trait Implementations§
source§impl<'de: 'a, 'a> Deserialize<'de> for Request<'a>
impl<'de: 'a, 'a> Deserialize<'de> for Request<'a>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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> !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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)