pub struct RuntimeBridge { /* private fields */ }Expand description
High-level bridge that owns a BridgeChannel and provides the public
command API for the bao_browser runtime.
In production, a worker loop reads from the associated BridgeReceiver
and dispatches commands to a servo PageHandle. In tests the channel
alone is exercised.
@trace REQ-BRW-003 [entity:RuntimeBridge]
Implementations§
Source§impl RuntimeBridge
impl RuntimeBridge
Sourcepub fn new() -> (Self, BridgeReceiver)
pub fn new() -> (Self, BridgeReceiver)
Create a fresh bridge, returning the sending half and the receiver.
Sourcepub fn send(&self, cmd: BridgeCommand) -> Result<BridgeResponse, String>
pub fn send(&self, cmd: BridgeCommand) -> Result<BridgeResponse, String>
Send a command and wait for the response. See BridgeChannel::send.
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.
See BridgeChannel::send_timeout.
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.
See BridgeChannel::fire_and_forget.
Sourcepub fn is_alive(&self) -> bool
pub fn is_alive(&self) -> bool
Whether the bridge is alive. See BridgeChannel::is_alive.
Sourcepub fn close(&self)
pub fn close(&self)
Mark the bridge closed. See BridgeChannel::close.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RuntimeBridge
impl RefUnwindSafe for RuntimeBridge
impl Send for RuntimeBridge
impl Sync for RuntimeBridge
impl Unpin for RuntimeBridge
impl UnsafeUnpin for RuntimeBridge
impl UnwindSafe for RuntimeBridge
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
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
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>
Creates a filterable data provider with the given name for debugging. Read more
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert