pub struct RpcResponse {
pub spec: String,
pub id: String,
pub status: u16,
pub content_type: String,
pub body_encoding: Option<String>,
pub body: Value,
}Fields§
§spec: String§id: String§status: u16§content_type: String§body_encoding: Option<String>§body: ValueImplementations§
Source§impl RpcResponse
impl RpcResponse
pub fn json_ok(id: impl Into<String>, body: Value) -> Self
pub fn binary_ok(id: impl Into<String>, bytes: &[u8]) -> Self
pub fn error( id: impl Into<String>, status: u16, message: impl Into<String>, ) -> Self
pub fn decode_body_bytes(&self) -> PrayResult<Vec<u8>>
pub fn decode_json_body<T: for<'de> Deserialize<'de>>(&self) -> PrayResult<T>
Trait Implementations§
Source§impl Clone for RpcResponse
impl Clone for RpcResponse
Source§fn clone(&self) -> RpcResponse
fn clone(&self) -> RpcResponse
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 RpcResponse
impl Debug for RpcResponse
Source§impl<'de> Deserialize<'de> for RpcResponse
impl<'de> Deserialize<'de> for RpcResponse
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
impl Eq for RpcResponse
Source§impl PartialEq for RpcResponse
impl PartialEq for RpcResponse
Source§impl Serialize for RpcResponse
impl Serialize for RpcResponse
impl StructuralPartialEq for RpcResponse
Auto Trait Implementations§
impl Freeze for RpcResponse
impl RefUnwindSafe for RpcResponse
impl Send for RpcResponse
impl Sync for RpcResponse
impl Unpin for RpcResponse
impl UnsafeUnpin for RpcResponse
impl UnwindSafe for RpcResponse
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