pub struct IpcResponse {
pub jsonrpc: String,
pub id: RequestId,
pub result: Option<Value>,
pub error: Option<IpcError>,
}Expand description
Response message sent from Rust to UI
Fields§
§jsonrpc: StringJSON-RPC version (always “2.0”)
id: RequestIdRequest ID this response corresponds to
result: Option<Value>Success result (mutually exclusive with error)
error: Option<IpcError>Error result (mutually exclusive with result)
Implementations§
Source§impl IpcResponse
impl IpcResponse
Sourcepub fn try_success(
id: RequestId,
result: impl Serialize,
) -> Result<IpcResponse, Error>
pub fn try_success( id: RequestId, result: impl Serialize, ) -> Result<IpcResponse, Error>
Try to create a success response.
Sourcepub fn success(id: RequestId, result: impl Serialize) -> IpcResponse
pub fn success(id: RequestId, result: impl Serialize) -> IpcResponse
Create a success response
Sourcepub fn error(id: RequestId, error: IpcError) -> IpcResponse
pub fn error(id: RequestId, error: IpcError) -> IpcResponse
Create an error response
Trait Implementations§
Source§impl Clone for IpcResponse
impl Clone for IpcResponse
Source§fn clone(&self) -> IpcResponse
fn clone(&self) -> IpcResponse
Returns a duplicate of the value. Read more
1.0.0 · 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 IpcResponse
impl Debug for IpcResponse
Source§impl<'de> Deserialize<'de> for IpcResponse
impl<'de> Deserialize<'de> for IpcResponse
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<IpcResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<IpcResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for IpcResponse
impl Serialize for IpcResponse
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for IpcResponse
impl RefUnwindSafe for IpcResponse
impl Send for IpcResponse
impl Sync for IpcResponse
impl Unpin for IpcResponse
impl UnsafeUnpin for IpcResponse
impl UnwindSafe for IpcResponse
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