pub struct IoContext<S: IoState, O: Origin = Solicited> {
pub reply: ReplyHeader,
request: O::Request,
state: S,
}Expand description
The server’s work item for one request (or one server event). Owns the reply
header and — while Solicited — the parsed request; parameterized by the
lifecycle state S and origin O.
Fields§
§reply: ReplyHeaderHeader the eventual reply is framed with.
request: O::RequestOwned request payload for this origin (SmbRequest for Solicited,
() otherwise). Accessed only through the state-appropriate methods.
state: SLifecycle state value (a ZST for data-less states; carries data for
Pending).
Implementations§
Source§impl IoContext<Accepted, Solicited>
impl IoContext<Accepted, Solicited>
Sourcepub fn accept(reply: ReplyHeader, request: SmbRequest) -> Self
pub fn accept(reply: ReplyHeader, request: SmbRequest) -> Self
Accept a parsed request for processing; the SmbRequest is moved in
and owned by the context from here on.
Source§impl IoContext<Accepted, Unsolicited>
impl IoContext<Accepted, Unsolicited>
Sourcepub fn from_event(reply: ReplyHeader) -> Self
pub fn from_event(reply: ReplyHeader) -> Self
Build a request-less context for a server-initiated response.
Trait Implementations§
Auto Trait Implementations§
impl<S, O> Freeze for IoContext<S, O>
impl<S, O> RefUnwindSafe for IoContext<S, O>
impl<S, O> Send for IoContext<S, O>
impl<S, O> Sync for IoContext<S, O>
impl<S, O> Unpin for IoContext<S, O>
impl<S, O> UnsafeUnpin for IoContext<S, O>
impl<S, O> UnwindSafe for IoContext<S, O>
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