pub struct BridgeServer { /* private fields */ }Expand description
A local WebSocket bridge that proxies JSON IpcRequest messages to the
daemon’s control channel and streams the JSON IpcResponse back.
This lets scriptable clients (browsers, websocat, monitoring tools) drive
the daemon over the same surface the CLI uses over its Unix socket.
Implementations§
Source§impl BridgeServer
impl BridgeServer
Sourcepub fn new(listen_addr: &str, ipc: IpcServer) -> Result<Self, SyncwebError>
pub fn new(listen_addr: &str, ipc: IpcServer) -> Result<Self, SyncwebError>
Construct a bridge from a listen address string.
§Errors
Returns an error if the listen address string cannot be parsed.
Sourcepub async fn run(self, shutdown: Sender<()>) -> Result<(), SyncwebError>
pub async fn run(self, shutdown: Sender<()>) -> Result<(), SyncwebError>
Bind the TCP listener and run until the shutdown signal is received.
§Errors
Returns an error if the TCP listener cannot be bound.
pub fn spawn(self, shutdown: Sender<()>) -> JoinHandle<Result<(), SyncwebError>> ⓘ
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<'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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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