Struct yedb::common::JSONRpcRequest [−][src]
pub struct JSONRpcRequest { pub id: Value, pub method: String, pub params: HashMap<String, Value>, // some fields omitted }
Fields
id: Value
method: String
params: HashMap<String, Value>
Implementations
impl JSONRpcRequest
[src]
impl JSONRpcRequest
[src]pub fn new(id: u64, method: &str) -> Self
[src]
pub fn set_param(&mut self, name: &str, value: Value)
[src]
pub fn pack(&self) -> Result<Vec<u8>, Error>
[src]
pub fn respond<T: Serialize>(&self, result: T) -> JSONRpcResponse<T>
[src]
pub fn respond_ok(&self) -> JSONRpcResponse<Value>
[src]
pub fn is_valid(&self) -> bool
[src]
pub fn error(&self, err: Error) -> JSONRpcResponse<Value>
[src]
pub fn params_valid(&self, params: Vec<&str>) -> bool
[src]
Trait Implementations
impl Debug for JSONRpcRequest
[src]
impl Debug for JSONRpcRequest
[src]impl<'de> Deserialize<'de> for JSONRpcRequest
[src]
impl<'de> Deserialize<'de> for JSONRpcRequest
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl Serialize for JSONRpcRequest
[src]
impl Serialize for JSONRpcRequest
[src]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
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]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
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,