[−][src]Struct jsonrpc_types::v1::Output
Represents success / failure output of JSON-RPC 1.0 response.
Fields
result: Option<Value>
Successful execution result.
error: Option<Error>
Failed execution error.
id: Id
Correlation id.
It MUST be the same as the value of the id member in the Request Object.
Implementations
impl Output
[src]
pub fn new(result: Result<Value, Error>, id: Id) -> Self
[src]
Creates a new response output with given result
and id
.
pub fn success(result: Value, id: Id) -> Self
[src]
Creates a JSON-RPC 1.0 success response output.
pub fn failure(error: Error, id: Id) -> Self
[src]
Creates a JSON-RPC 1.0 failure response output.
pub fn invalid_request(id: Id) -> Self
[src]
Creates a new failure response output indicating malformed request.
Trait Implementations
impl Clone for Output
[src]
impl Debug for Output
[src]
impl<'de> Deserialize<'de> for Output
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Display for Output
[src]
impl Eq for Output
[src]
impl PartialEq<Output> for Output
[src]
impl Serialize for Output
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Output
[src]
impl StructuralPartialEq for Output
[src]
Auto Trait Implementations
impl RefUnwindSafe for Output
[src]
impl Send for Output
[src]
impl Sync for Output
[src]
impl Unpin for Output
[src]
impl UnwindSafe for Output
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,