pub struct BridgeChannel { /* private fields */ }Expand description
Producer half of the bridge command channel.
Methods are thread-safe (&self) so a single channel can be shared across
threads for concurrent submission.
@trace REQ-BRW-003 [entity:BridgeChannel]
Implementations§
Source§impl BridgeChannel
impl BridgeChannel
Sourcepub fn new() -> (Self, BridgeReceiver)
pub fn new() -> (Self, BridgeReceiver)
Create a new bridge channel pair.
Returns (sender, receiver) where commands flow sender → receiver and
responses flow back via per-command one-shot channels.
Sourcepub fn send(&self, cmd: BridgeCommand) -> Result<BridgeResponse, String>
pub fn send(&self, cmd: BridgeCommand) -> Result<BridgeResponse, String>
Send a command and block until the worker returns a response.
Sourcepub fn send_timeout(
&self,
cmd: BridgeCommand,
timeout: Duration,
) -> Result<BridgeResponse, String>
pub fn send_timeout( &self, cmd: BridgeCommand, timeout: Duration, ) -> Result<BridgeResponse, String>
Send a command and wait at most timeout for a response.
Sourcepub fn fire_and_forget(&self, cmd: BridgeCommand) -> Result<(), String>
pub fn fire_and_forget(&self, cmd: BridgeCommand) -> Result<(), String>
Send a command without waiting for a response.
The worker receives None for the responder slot and can skip
the response-send step.
Sourcepub fn close(&self)
pub fn close(&self)
Mark the bridge as closed.
This only sets a flag — the underlying channel remains connected.
Dropping the BridgeChannel / BridgeReceiver pair fully tears
down the transport.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BridgeChannel
impl RefUnwindSafe for BridgeChannel
impl Send for BridgeChannel
impl Sync for BridgeChannel
impl Unpin for BridgeChannel
impl UnsafeUnpin for BridgeChannel
impl UnwindSafe for BridgeChannel
Blanket Implementations§
Source§impl<T> AsCtxPtr for Twhere
T: ?Sized,
impl<T> AsCtxPtr for Twhere
T: ?Sized,
Source§fn as_ctx_ptr(&self) -> *mut Selfwhere
Self: Sized,
fn as_ctx_ptr(&self) -> *mut Selfwhere
Self: Sized,
self’s address as *mut Self for deferred-task / scopeguard /
ref_guard ctx slots. The closures/trampolines deref it as shared
(&*p) — every method they reach is &self post-R-2, so no write
provenance is required; the *mut spelling is purely to match the
existing DerefOnDrop / HasAutoFlush / RefCount ABI.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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
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