pub struct BrowserExtensionContext<'a> { /* private fields */ }Implementations§
Source§impl<'a> BrowserExtensionContext<'a>
impl<'a> BrowserExtensionContext<'a>
pub fn new(host: &'a mut dyn BrowserExtensionHost) -> Self
Sourcepub fn with_ownership(
host: &'a mut dyn BrowserExtensionHost,
vm_id: Option<String>,
connection_id: Option<String>,
) -> Self
pub fn with_ownership( host: &'a mut dyn BrowserExtensionHost, vm_id: Option<String>, connection_id: Option<String>, ) -> Self
Construct with the wire ownership scope threaded in (VM + connection), so extensions can target the right VM and enforce per-connection ownership.
Sourcepub fn connection_id(&self) -> Option<&str>
pub fn connection_id(&self) -> Option<&str>
Owning connection of this request, if any.
pub fn write_file( &mut self, vm_id: &str, path: &str, contents: impl Into<Vec<u8>>, ) -> Result<(), BrowserSidecarError>
pub fn read_file( &mut self, vm_id: &str, path: &str, ) -> Result<Vec<u8>, BrowserSidecarError>
pub fn mkdir( &mut self, vm_id: &str, path: &str, recursive: bool, ) -> Result<(), BrowserSidecarError>
pub fn read_dir( &mut self, vm_id: &str, path: &str, ) -> Result<Vec<String>, BrowserSidecarError>
pub fn create_javascript_context( &mut self, request: CreateJavascriptContextRequest, ) -> Result<GuestContextHandle, BrowserSidecarError>
pub fn create_wasm_context( &mut self, request: CreateWasmContextRequest, ) -> Result<GuestContextHandle, BrowserSidecarError>
pub fn start_execution( &mut self, request: StartExecutionRequest, ) -> Result<StartedExecution, BrowserSidecarError>
pub fn write_stdin( &mut self, request: WriteExecutionStdinRequest, ) -> Result<(), BrowserSidecarError>
pub fn close_stdin( &mut self, request: ExecutionHandleRequest, ) -> Result<(), BrowserSidecarError>
pub fn kill_execution( &mut self, request: KillExecutionRequest, ) -> Result<(), BrowserSidecarError>
pub fn poll_execution_event( &mut self, request: PollExecutionEventRequest, ) -> Result<Option<ExecutionEvent>, BrowserSidecarError>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for BrowserExtensionContext<'a>
impl<'a> !Send for BrowserExtensionContext<'a>
impl<'a> !Sync for BrowserExtensionContext<'a>
impl<'a> !UnwindSafe for BrowserExtensionContext<'a>
impl<'a> Freeze for BrowserExtensionContext<'a>
impl<'a> Unpin for BrowserExtensionContext<'a>
impl<'a> UnsafeUnpin for BrowserExtensionContext<'a>
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> 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