pub struct Response {
pub result: Result<ResponseValue, Error>,
pub correlation_id: CorrelationId,
}Expand description
The result of a Query or Command. Carried inside a Message
with operation = Response. A Response contains either a value or
an Error; never both, never neither.
Fields§
§result: Result<ResponseValue, Error>The result. Either a value or an error.
correlation_id: CorrelationIdCorrelation id — required on responses.
Implementations§
Source§impl Response
impl Response
Sourcepub fn ok(value: ResponseValue, correlation_id: CorrelationId) -> Self
pub fn ok(value: ResponseValue, correlation_id: CorrelationId) -> Self
Construct a successful response.
Sourcepub fn err(error: Error, correlation_id: CorrelationId) -> Self
pub fn err(error: Error, correlation_id: CorrelationId) -> Self
Construct an error response.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Response
impl<'de> Deserialize<'de> for Response
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 StructuralPartialEq for Response
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
impl UnwindSafe for Response
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