pub enum RawJsonRpcMessage {
Request(Request<RawJsonRpcParams>),
Notification(Notification<RawJsonRpcParams>),
Response(Response<Value>),
}Expand description
Raw JSON-RPC message transported by Channel.
This uses the JSON-RPC envelope types from agent-client-protocol-schema
while keeping method params as raw, JSON-RPC-valid params at the transport boundary.
Variants§
Request(Request<RawJsonRpcParams>)
A JSON-RPC request with an id and expected response.
Notification(Notification<RawJsonRpcParams>)
A JSON-RPC notification without a response.
Response(Response<Value>)
A JSON-RPC response to a prior request.
Implementations§
Source§impl RawJsonRpcMessage
impl RawJsonRpcMessage
Sourcepub fn request(
method: String,
params: Value,
id: RequestId,
) -> Result<Self, Error>
pub fn request( method: String, params: Value, id: RequestId, ) -> Result<Self, Error>
Build a raw JSON-RPC request message.
Sourcepub fn notification(method: String, params: Value) -> Result<Self, Error>
pub fn notification(method: String, params: Value) -> Result<Self, Error>
Build a raw JSON-RPC notification message.
Sourcepub fn response(id: RequestId, response: Result<Value, Error>) -> Self
pub fn response(id: RequestId, response: Result<Value, Error>) -> Self
Build a raw JSON-RPC response message.
Sourcepub fn response_id(&self) -> Option<&RequestId>
pub fn response_id(&self) -> Option<&RequestId>
The response id, if this is a response.
Trait Implementations§
Source§impl Clone for RawJsonRpcMessage
impl Clone for RawJsonRpcMessage
Source§fn clone(&self) -> RawJsonRpcMessage
fn clone(&self) -> RawJsonRpcMessage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RawJsonRpcMessage
impl Debug for RawJsonRpcMessage
Source§impl<'de> Deserialize<'de> for RawJsonRpcMessage
impl<'de> Deserialize<'de> for RawJsonRpcMessage
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 Freeze for RawJsonRpcMessage
impl RefUnwindSafe for RawJsonRpcMessage
impl Send for RawJsonRpcMessage
impl Sync for RawJsonRpcMessage
impl Unpin for RawJsonRpcMessage
impl UnsafeUnpin for RawJsonRpcMessage
impl UnwindSafe for RawJsonRpcMessage
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.