pub struct BridgeServer { /* private fields */ }Expand description
A running bridge instance: both loopback-TCP planes bound and serving, with
a CancellationToken for graceful shutdown.
Created by BridgeServer::start, which returns once the planes are bound
(fail-closed) and the accept loops are spawned. A standalone serve calls
wait (run until Ctrl-C); a supervisor (the daemon) instead
drives status / disconnect_tab /
shutdown directly.
Implementations§
Source§impl BridgeServer
impl BridgeServer
Sourcepub fn start(config: BridgeConfig, token: String) -> Result<Self>
pub fn start(config: BridgeConfig, token: String) -> Result<Self>
Binds both planes (fail-closed), spawns the accept loops, and returns
immediately. token is the already-resolved session token (never
sourced from argv).
Sourcepub fn control_port(&self) -> u16
pub fn control_port(&self) -> u16
The bound control-plane port (resolved if 0 was requested).
Sourcepub fn status(&self) -> StatusResponse
pub fn status(&self) -> StatusResponse
A synchronous snapshot of connection status (the same payload the
GET /__bridge/status endpoint returns).
Sourcepub fn disconnect_tab(&self, id: u64) -> Result<()>
pub fn disconnect_tab(&self, id: u64) -> Result<()>
Disconnects the tab with the given connection id: sends a WebSocket Close and drops it from the registry. Errors if no such tab is connected.
Auto Trait Implementations§
impl !RefUnwindSafe for BridgeServer
impl !UnwindSafe for BridgeServer
impl Freeze for BridgeServer
impl Send for BridgeServer
impl Sync for BridgeServer
impl Unpin for BridgeServer
impl UnsafeUnpin for BridgeServer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more