pub struct CompositeBridge { /* private fields */ }Expand description
Compose multiple bridges into one.
Each bridge handles its own globals. When a call comes in, the composite
tries each bridge in order until one succeeds. This lets you combine
jsdet-browser + custom hooks without modifying either.
Implementations§
Trait Implementations§
Source§impl Bridge for CompositeBridge
impl Bridge for CompositeBridge
Source§fn call(&self, api: &str, args: &[Value]) -> Result<Value, String>
fn call(&self, api: &str, args: &[Value]) -> Result<Value, String>
Handle a function call from JavaScript. Read more
Source§fn get_property(&self, object: &str, property: &str) -> Result<Value, String>
fn get_property(&self, object: &str, property: &str) -> Result<Value, String>
Handle a property read from JavaScript. Read more
Source§fn set_property(
&self,
object: &str,
property: &str,
value: &Value,
) -> Result<(), String>
fn set_property( &self, object: &str, property: &str, value: &Value, ) -> Result<(), String>
Handle a property write from JavaScript. Read more
Source§fn provided_globals(&self) -> Vec<String>
fn provided_globals(&self) -> Vec<String>
Return the list of global objects this bridge provides. Read more
Source§fn bootstrap_js(&self) -> String
fn bootstrap_js(&self) -> String
Return the JS bootstrap code that installs this bridge’s API surface. Read more
Auto Trait Implementations§
impl Freeze for CompositeBridge
impl !RefUnwindSafe for CompositeBridge
impl Send for CompositeBridge
impl Sync for CompositeBridge
impl Unpin for CompositeBridge
impl UnsafeUnpin for CompositeBridge
impl !UnwindSafe for CompositeBridge
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
Mutably borrows from an owned value. Read more
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