pub enum Reply {
Ok(Value),
Err {
error: String,
detail: Option<Value>,
},
}Expand description
One reply. detail carries machine-readable context for an error (a CommandError as JSON,
the step results of a failed batch).
Variants§
Implementations§
Source§impl Reply
impl Reply
pub fn ok(v: Value) -> Self
pub fn err(e: impl Display) -> Self
pub fn err_with(e: impl Display, detail: Value) -> Self
Sourcepub fn from_command(r: Result<Value, CommandError>) -> Self
pub fn from_command(r: Result<Value, CommandError>) -> Self
A command’s outcome; errors keep their kind in detail.
pub fn is_ok(&self) -> bool
Sourcepub fn to_json(&self, id: Option<&Value>) -> Value
pub fn to_json(&self, id: Option<&Value>) -> Value
The wire object, with id when the request had one.
Trait Implementations§
impl StructuralPartialEq for Reply
Auto Trait Implementations§
impl Forget for Reply
impl Freeze for Reply
impl Move for Reply
impl RefUnwindSafe for Reply
impl Send for Reply
impl Sync for Reply
impl Unpin for Reply
impl UnsafeUnpin for Reply
impl UnwindSafe for Reply
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