[−][src]Struct jsonrpc_types::v1::Output
Represents success / failure output of JSON-RPC 1.0 response.
Fields
result: Option<T>
Successful execution result.
error: Option<Error>
Failed execution error.
id: Option<Id>
Correlation id.
It MUST be the same as the value of the id member in the Request Object.
If there was an error in detecting the id in the Request object (e.g. Parse error/Invalid Request), it MUST be Null.
Implementations
impl<T: Serialize + DeserializeOwned> Output<T>
[src]
pub fn success(result: T, id: Id) -> Self
[src]
Creates a JSON-RPC 1.0 success response output.
pub fn failure(error: Error, id: Option<Id>) -> Self
[src]
Creates a JSON-RPC 1.0 failure response output.
pub fn invalid_request(id: Option<Id>) -> Self
[src]
Creates a new failure response output indicating malformed request.
Trait Implementations
impl<T: Clone> Clone for Output<T>
[src]
impl<T: Debug> Debug for Output<T>
[src]
impl<'de, T: Deserialize<'de>> Deserialize<'de> for Output<T>
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl<T: Serialize> Display for Output<T>
[src]
impl<T: Eq> Eq for Output<T>
[src]
impl<T: PartialEq> PartialEq<Output<T>> for Output<T>
[src]
impl<T> Serialize for Output<T> where
T: Serialize,
[src]
T: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<T> StructuralEq for Output<T>
[src]
impl<T> StructuralPartialEq for Output<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Output<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for Output<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for Output<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for Output<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for Output<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
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>,