pub struct ServiceRequest {
pub input: DataId,
pub id: RequestId,
pub metadata: Metadata,
pub payload: Payload,
}Expand description
An incoming service request, as the server sees it.
Fields§
§input: DataIdThe input it arrived on.
id: RequestIdIts correlation id.
metadata: MetadataThe metadata to pass to Node::service_response.
payload: PayloadThe request payload.
Implementations§
Source§impl ServiceRequest
impl ServiceRequest
Sourcepub fn from_event(event: Event) -> Result<Self, Box<Event>>
pub fn from_event(event: Event) -> Result<Self, Box<Event>>
Reads a request out of an event, if it is one.
An input with no request_id is not a service request — it is an
ordinary message, and a server that treated it as one would answer
into the void.
Sourcepub fn view<T: FromPayload>(&self) -> Result<T>
pub fn view<T: FromPayload>(&self) -> Result<T>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ServiceRequest
impl !RefUnwindSafe for ServiceRequest
impl !UnwindSafe for ServiceRequest
impl Send for ServiceRequest
impl Sync for ServiceRequest
impl Unpin for ServiceRequest
impl UnsafeUnpin for ServiceRequest
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