pub struct HostSession { /* private fields */ }Expand description
The daemon’s end of a device connection.
Implementations§
Source§impl HostSession
impl HostSession
Sourcepub fn new(config: HostConfig, now: Instant) -> HostSession
pub fn new(config: HostConfig, now: Instant) -> HostSession
Starts waiting for the agent’s hello; it must arrive within the peer timeout.
Sourcepub fn receive_eof(&mut self, now: Instant)
pub fn receive_eof(&mut self, now: Instant)
The connection reached its end.
Sourcepub fn handle_timeout(&mut self, now: Instant)
pub fn handle_timeout(&mut self, now: Instant)
Acts on deadlines and liveness that are due at now.
Sourcepub fn poll_timeout(&self) -> Option<Instant>
pub fn poll_timeout(&self) -> Option<Instant>
When handle_timeout must next run; None once closed.
Sourcepub fn send_request(
&mut self,
call: Call,
deadline: Option<Duration>,
now: Instant,
) -> Result<u32, Error>
pub fn send_request( &mut self, call: Call, deadline: Option<Duration>, now: Instant, ) -> Result<u32, Error>
Sends a request, returning its id. Fails at once, sending nothing, when the session is not ready or closed, when the agent did not advertise the capability the method needs, or when the request exceeds the negotiated frame size.
Sourcepub fn resync(&mut self, stream: Stream, now: Instant) -> Result<u32, Error>
pub fn resync(&mut self, stream: Stream, now: Instant) -> Result<u32, Error>
Asks the agent to resynchronize stream; the outcome arrives as
HostEvent::Resynced or HostEvent::ResyncFailed.
Sourcepub fn streams(&self) -> &StreamTracker
pub fn streams(&self) -> &StreamTracker
Sequence state of the event streams.
Sourcepub fn poll_transmit(&mut self) -> Option<Vec<u8>>
pub fn poll_transmit(&mut self) -> Option<Vec<u8>>
Bytes to write to the connection.
pub fn poll_event(&mut self) -> Option<HostEvent>
Sourcepub fn negotiated(&self) -> Option<&Negotiated>
pub fn negotiated(&self) -> Option<&Negotiated>
What the handshake settled, once it has.
pub fn is_closed(&self) -> bool
Sourcepub fn close_reason(&self) -> Option<&DisconnectReason>
pub fn close_reason(&self) -> Option<&DisconnectReason>
Why the session closed, once it has.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HostSession
impl RefUnwindSafe for HostSession
impl Send for HostSession
impl Sync for HostSession
impl Unpin for HostSession
impl UnsafeUnpin for HostSession
impl UnwindSafe for HostSession
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