pub struct ServerState { /* private fields */ }Implementations§
Source§impl ServerState
impl ServerState
pub fn new(listen_addr: SocketAddr) -> Self
pub fn started_at(&self) -> SystemTime
pub fn listen_addr(&self) -> SocketAddr
pub fn client_count(&self) -> usize
pub fn tunnel_count(&self) -> usize
pub fn conn_count(&self) -> usize
pub fn register_client( &self, id: u64, remote: SocketAddr, conn: Connection, ) -> Arc<ClientEntry>
pub fn deregister_client(&self, id: u64, reason: impl Into<String>)
Sourcepub fn register_tunnels(
&self,
client: &ClientEntry,
requests: &[RemoteRequest],
) -> Vec<Arc<TunnelEntry>>
pub fn register_tunnels( &self, client: &ClientEntry, requests: &[RemoteRequest], ) -> Vec<Arc<TunnelEntry>>
Bulk-register every tunnel declared in the client’s session
hello, returning the freshly minted entries in the same order
as requests. Allocates a fresh tunnel_id per declaration —
duplicate specs in a single hello produce two separate
tunnels (the wire protocol no longer needs dedup, since
forward conns no longer re-send a RemoteRequest per stream).
pub fn tunnel(&self, id: u64) -> Option<Arc<TunnelEntry>>
pub fn tunnels_snapshot(&self) -> Vec<Arc<TunnelEntry>>
Sourcepub fn register_conn(
&self,
tunnel: &Arc<TunnelEntry>,
peer: Option<String>,
) -> ConnGuard
pub fn register_conn( &self, tunnel: &Arc<TunnelEntry>, peer: Option<String>, ) -> ConnGuard
Register a fresh conn against tunnel and return a
ConnGuard whose Drop impl will deregister it (rolling its
byte counters into the tunnel’s cumulative totals). The guard
exposes ConnGuard::counters which is what the data-plane
handler should pass to crate::common::tcp::tunnel_tcp_stream
/ udp / socks.
pub fn conn(&self, id: u64) -> Option<Arc<ConnEntry>>
pub fn conns_snapshot(&self) -> Vec<Arc<ConnEntry>>
pub fn clients_snapshot(&self) -> Vec<Arc<ClientEntry>>
pub fn client(&self, id: u64) -> Option<Arc<ClientEntry>>
pub fn history_snapshot(&self, limit: usize) -> Vec<HistoryEntry>
Trait Implementations§
Source§impl Clone for ServerState
impl Clone for ServerState
Source§fn clone(&self) -> ServerState
fn clone(&self) -> ServerState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ServerState
impl !UnwindSafe for ServerState
impl Freeze for ServerState
impl Send for ServerState
impl Sync for ServerState
impl Unpin for ServerState
impl UnsafeUnpin for ServerState
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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