Struct yedb::common::JSONRpcRequest
source · [−]pub struct JSONRpcRequest {
pub id: Value,
pub method: String,
pub params: HashMap<String, Value>,
/* private fields */
}
Fields
id: Value
method: String
params: HashMap<String, Value>
Implementations
sourceimpl JSONRpcRequest
impl JSONRpcRequest
pub fn new(id: u64, method: &str) -> Self
pub fn with_params(
id: u64,
method: &str,
params: HashMap<String, Value>
) -> Self
pub fn set_param(&mut self, name: &str, value: Value)
pub fn respond<T: Serialize>(&self, result: T) -> JSONRpcResponse<T>
pub fn respond_ok(&self) -> JSONRpcResponse<Value>
pub fn is_valid(&self) -> bool
pub fn error(&self, err: Error) -> JSONRpcResponse<Value>
pub fn params_valid(&self, params: Vec<&str>) -> bool
Trait Implementations
sourceimpl Debug for JSONRpcRequest
impl Debug for JSONRpcRequest
sourceimpl<'de> Deserialize<'de> for JSONRpcRequest
impl<'de> Deserialize<'de> for JSONRpcRequest
sourcefn 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
sourceimpl Serialize for JSONRpcRequest
impl Serialize for JSONRpcRequest
Auto Trait Implementations
impl RefUnwindSafe for JSONRpcRequest
impl Send for JSONRpcRequest
impl Sync for JSONRpcRequest
impl Unpin for JSONRpcRequest
impl UnwindSafe for JSONRpcRequest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self