pub struct Context<'a, Session, Input, Output, State> {
pub session: &'a mut Session,
pub input: &'a mut Input,
pub output: &'a mut Output,
pub state: &'a mut State,
pub buf: &'a [u8],
pub eof: bool,
}
Expand description
Context provides an interface to use a Session
, IO streams
and a state.
It’s used primarily in callbacks for InteractSession
.
Fields§
§session: &'a mut Session
The field contains a &mut reference to a Session
.
input: &'a mut Input
The field contains an input structure which was used in InteractSession
.
output: &'a mut Output
The field contains an output structure which was used in InteractSession
.
state: &'a mut State
The field contains a user defined data.
buf: &'a [u8]
The field contains a bytes which were consumed from a user or the running process.
eof: bool
A flag for EOF of a user session or running process.
Implementations§
source§impl<'a, Session, Input, Output, State> Context<'a, Session, Input, Output, State>
impl<'a, Session, Input, Output, State> Context<'a, Session, Input, Output, State>
sourcepub fn new(
session: &'a mut Session,
input: &'a mut Input,
output: &'a mut Output,
state: &'a mut State,
buf: &'a [u8],
eof: bool
) -> Self
pub fn new( session: &'a mut Session, input: &'a mut Input, output: &'a mut Output, state: &'a mut State, buf: &'a [u8], eof: bool ) -> Self
Creates a new Context
structure.
Trait Implementations§
Auto Trait Implementations§
impl<'a, Session, Input, Output, State> RefUnwindSafe for Context<'a, Session, Input, Output, State>where Input: RefUnwindSafe, Output: RefUnwindSafe, Session: RefUnwindSafe, State: RefUnwindSafe,
impl<'a, Session, Input, Output, State> Send for Context<'a, Session, Input, Output, State>where Input: Send, Output: Send, Session: Send, State: Send,
impl<'a, Session, Input, Output, State> Sync for Context<'a, Session, Input, Output, State>where Input: Sync, Output: Sync, Session: Sync, State: Sync,
impl<'a, Session, Input, Output, State> Unpin for Context<'a, Session, Input, Output, State>
impl<'a, Session, Input, Output, State> !UnwindSafe for Context<'a, Session, Input, Output, State>
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