pub struct JsonRpcMethod<I, O, E>where
E: MapErrorCode,{
pub method: &'static str,
/* private fields */
}
Fields§
§method: &'static str
Implementations§
Source§impl<I, O, E> JsonRpcMethod<I, O, E>where
E: MapErrorCode,
impl<I, O, E> JsonRpcMethod<I, O, E>where
E: MapErrorCode,
pub const fn new(method: &'static str) -> Self
pub const fn name(&self) -> &'static str
pub fn create_request( &self, params: I, json_rpc_id: String, ) -> JsonRpcRequest<I>
Source§impl<O, E> JsonRpcMethod<NoParams, O, E>where
E: MapErrorCode,
impl<O, E> JsonRpcMethod<NoParams, O, E>where
E: MapErrorCode,
pub fn create_request_no_params( &self, json_rpc_id: String, ) -> JsonRpcRequest<NoParams>
Source§impl<'de, I, O, E> JsonRpcMethod<I, O, E>
impl<'de, I, O, E> JsonRpcMethod<I, O, E>
pub fn parse_json_response_str( &self, json_str: &'de str, ) -> Result<JsonRpcResponse<O, E>, Error>
Source§impl<I, O, E> JsonRpcMethod<I, O, E>
impl<I, O, E> JsonRpcMethod<I, O, E>
pub fn parse_json_response_value( &self, json_value: Value, ) -> Result<JsonRpcResponse<O, E>, Error>
Source§impl<I, O, E> JsonRpcMethod<I, O, E>where
I: DeserializeOwned + Serialize + 'static,
O: DeserializeOwned + Serialize + 'static,
E: DeserializeOwned + Serialize + 'static + MapErrorCode,
impl<I, O, E> JsonRpcMethod<I, O, E>where
I: DeserializeOwned + Serialize + 'static,
O: DeserializeOwned + Serialize + 'static,
E: DeserializeOwned + Serialize + 'static + MapErrorCode,
pub fn erase_box(self) -> Box<dyn JsonRpcMethodErased>
pub fn ref_erase(&self) -> &dyn JsonRpcMethodErased
Trait Implementations§
Source§impl<I: Debug, O: Debug, E> Debug for JsonRpcMethod<I, O, E>where
E: MapErrorCode + Debug,
impl<I: Debug, O: Debug, E> Debug for JsonRpcMethod<I, O, E>where
E: MapErrorCode + Debug,
Source§impl<I, O, E> Deserialize<'static> for JsonRpcMethod<I, O, E>where
E: MapErrorCode,
impl<I, O, E> Deserialize<'static> for JsonRpcMethod<I, O, E>where
E: MapErrorCode,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'static>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'static>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<I, O, E> From<&JsonRpcMethod<I, O, E>> for Stringwhere
E: MapErrorCode,
impl<I, O, E> From<&JsonRpcMethod<I, O, E>> for Stringwhere
E: MapErrorCode,
Source§fn from(value: &JsonRpcMethod<I, O, E>) -> Self
fn from(value: &JsonRpcMethod<I, O, E>) -> Self
Converts to this type from the input type.
Source§impl<I, O, E> JsonRpcMethodErased for JsonRpcMethod<I, O, E>where
I: DeserializeOwned + Serialize,
O: DeserializeOwned + Serialize,
E: DeserializeOwned + Serialize + MapErrorCode,
impl<I, O, E> JsonRpcMethodErased for JsonRpcMethod<I, O, E>where
I: DeserializeOwned + Serialize,
O: DeserializeOwned + Serialize,
E: DeserializeOwned + Serialize + MapErrorCode,
fn name(&self) -> &str
fn create_request( &self, params: Vec<u8>, json_rpc_id: String, ) -> Result<JsonRpcRequestErased, Error>
fn parse_json_response_str( &self, json_str: &str, ) -> Result<JsonRpcResponseErased, Error>
fn parse_json_response_value( &self, json_value: Value, ) -> Result<JsonRpcResponseErased, Error>
Source§impl<'a, I, O, E> JsonRpcMethodUnerased<'a, I, O, E> for JsonRpcMethod<I, O, E>
impl<'a, I, O, E> JsonRpcMethodUnerased<'a, I, O, E> for JsonRpcMethod<I, O, E>
fn name(&self) -> &str
fn create_request( &self, params: I, json_rpc_id: String, ) -> Result<JsonRpcRequest<I>, Error>
fn parse_json_response_str( &self, json_str: &str, ) -> Result<JsonRpcResponse<O, E>, Error>
fn parse_json_response_value( &self, json_value: Value, ) -> Result<JsonRpcResponse<O, E>, Error>
Source§impl<I, O, E> Serialize for JsonRpcMethod<I, O, E>where
E: MapErrorCode,
impl<I, O, E> Serialize for JsonRpcMethod<I, O, E>where
E: MapErrorCode,
Auto Trait Implementations§
impl<I, O, E> Freeze for JsonRpcMethod<I, O, E>
impl<I, O, E> RefUnwindSafe for JsonRpcMethod<I, O, E>
impl<I, O, E> Send for JsonRpcMethod<I, O, E>
impl<I, O, E> Sync for JsonRpcMethod<I, O, E>
impl<I, O, E> Unpin for JsonRpcMethod<I, O, E>
impl<I, O, E> UnwindSafe for JsonRpcMethod<I, O, E>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Downcast for T
impl<T> Downcast for T
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request