pub struct ServiceResponse {
pub input: DataId,
pub id: RequestId,
pub metadata: Metadata,
pub payload: Payload,
}Expand description
An incoming service response, as the client sees it.
Fields§
§input: DataIdThe input it arrived on.
id: RequestIdThe id of the request it answers.
metadata: MetadataIts metadata.
payload: PayloadThe response payload.
Implementations§
Source§impl ServiceResponse
impl ServiceResponse
Sourcepub fn from_event(event: Event) -> Result<Self, Box<Event>>
pub fn from_event(event: Event) -> Result<Self, Box<Event>>
Reads a response out of an event, if it is one.
Sourcepub fn view<T: FromPayload>(&self) -> Result<T>
pub fn view<T: FromPayload>(&self) -> Result<T>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ServiceResponse
impl !RefUnwindSafe for ServiceResponse
impl !UnwindSafe for ServiceResponse
impl Send for ServiceResponse
impl Sync for ServiceResponse
impl Unpin for ServiceResponse
impl UnsafeUnpin for ServiceResponse
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