pub struct ServerSession<P: Protocol, S: ServerState> { /* private fields */ }Expand description
A typed server-side reflector session.
P is the protocol marker (crate::session::client::DExtra,
crate::session::client::DPlus, crate::session::client::Dcs).
S is the server state marker (super::Unknown,
super::Link1Received, super::Linked, etc.).
Implementations§
Source§impl<P: Protocol, S: ServerState> ServerSession<P, S>
impl<P: Protocol, S: ServerState> ServerSession<P, S>
Sourcepub const fn state_kind(&self) -> ServerStateKind
pub const fn state_kind(&self) -> ServerStateKind
Runtime state discriminator.
Sourcepub const fn peer(&self) -> SocketAddr
pub const fn peer(&self) -> SocketAddr
Peer address.
Sourcepub fn pop_event(&mut self) -> Option<ServerEvent<P>>
pub fn pop_event(&mut self) -> Option<ServerEvent<P>>
Drain the next server event.
Source§impl<P: Protocol> ServerSession<P, Streaming>
impl<P: Protocol> ServerSession<P, Streaming>
Source§impl ServerSession<DPlus, Link1Received>
impl ServerSession<DPlus, Link1Received>
Sourcepub fn handle_link2(
self,
now: Instant,
_callsign: Callsign,
bytes: &[u8],
) -> Result<ServerSession<DPlus, Linked>, Error>
pub fn handle_link2( self, now: Instant, _callsign: Callsign, bytes: &[u8], ) -> Result<ServerSession<DPlus, Linked>, Error>
Process a DPlus LINK2 packet after a LINK1 has been
received.
Only available on ServerSession<DPlus, Link1Received> —
calling this before LINK1 (in the super::Unknown state)
is a compile error.
§Errors
Returns any Error the core propagates.
Source§impl<P: Protocol> ServerSession<P, Linked>
impl<P: Protocol> ServerSession<P, Linked>
Sourcepub fn handle_unlink(
self,
now: Instant,
bytes: &[u8],
) -> Result<ServerSession<P, Closed>, Error>
pub fn handle_unlink( self, now: Instant, bytes: &[u8], ) -> Result<ServerSession<P, Closed>, Error>
Trait Implementations§
Auto Trait Implementations§
impl<P, S> Freeze for ServerSession<P, S>
impl<P, S> RefUnwindSafe for ServerSession<P, S>where
P: RefUnwindSafe,
S: RefUnwindSafe,
impl<P, S> Send for ServerSession<P, S>where
S: Send,
impl<P, S> Sync for ServerSession<P, S>where
S: Sync,
impl<P, S> Unpin for ServerSession<P, S>
impl<P, S> UnwindSafe for ServerSession<P, S>where
P: UnwindSafe,
S: UnwindSafe,
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