Skip to main content

UnitSession

Trait UnitSession 

Source
pub trait UnitSession: Send {
    // Required methods
    fn submit(&mut self, op: UnitOp);
    fn is_idle(&self) -> bool;
    fn poll_transmit(&mut self, now: Instant) -> Option<Vec<u8>>;
    fn next_deadline(&self) -> Option<Instant>;
    fn handle_timeout(&mut self, now: Instant);
    fn handle_input(&mut self, bytes: &[u8]);
    fn poll_event(&mut self) -> Option<UnitEvent>;
}
Expand description

A sans-IO session speaking UnitOp.

Required Methods§

Source

fn submit(&mut self, op: UnitOp)

Source

fn is_idle(&self) -> bool

Source

fn poll_transmit(&mut self, now: Instant) -> Option<Vec<u8>>

Source

fn next_deadline(&self) -> Option<Instant>

Source

fn handle_timeout(&mut self, now: Instant)

Source

fn handle_input(&mut self, bytes: &[u8])

Source

fn poll_event(&mut self) -> Option<UnitEvent>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§