pub struct EmptyBridge;Expand description
A bridge that provides no APIs. Useful for testing the core sandbox in isolation — scripts execute but all API calls throw.
Trait Implementations§
Source§impl Bridge for EmptyBridge
impl Bridge for EmptyBridge
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 EmptyBridge
impl RefUnwindSafe for EmptyBridge
impl Send for EmptyBridge
impl Sync for EmptyBridge
impl Unpin for EmptyBridge
impl UnsafeUnpin for EmptyBridge
impl UnwindSafe for EmptyBridge
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