pub struct BrowserSidecar<B> { /* private fields */ }Implementations§
Source§impl<B> BrowserSidecar<B>
impl<B> BrowserSidecar<B>
pub fn new(bridge: B, config: BrowserSidecarConfig) -> Self
pub fn with_extensions( bridge: B, config: BrowserSidecarConfig, extensions: Vec<Box<dyn BrowserExtension>>, ) -> Result<Self, BrowserSidecarError>
pub fn register_extension( &mut self, extension: Box<dyn BrowserExtension>, ) -> Result<(), BrowserSidecarError>
pub fn extension_count(&self) -> usize
pub fn has_extension(&self, namespace: &str) -> bool
pub fn dispatch_extension_request( &mut self, request: BrowserExtensionRequest, ) -> Result<BrowserExtensionResponse, BrowserSidecarError>
pub fn sidecar_id(&self) -> &str
pub fn bridge(&self) -> &B
pub fn bridge_mut(&mut self) -> &mut B
pub fn into_bridge(self) -> B
pub fn vm_count(&self) -> usize
pub fn context_count(&self, vm_id: &str) -> usize
pub fn active_worker_count(&self, vm_id: &str) -> usize
pub fn create_vm( &mut self, config: KernelVmConfig, ) -> Result<(), BrowserSidecarError>
pub fn configure_vm( &mut self, vm_id: &str, permissions: Option<Permissions>, instructions: Vec<String>, projected_modules: Vec<ProjectedModuleDescriptor>, command_permissions: BTreeMap<String, WasmPermissionTier>, loopback_exempt_ports: impl IntoIterator<Item = u16>, ) -> Result<(), BrowserSidecarError>
pub fn create_vm_with_root_filesystem( &mut self, config: KernelVmConfig, root_filesystem: RootFilesystemConfig, ) -> Result<(), BrowserSidecarError>
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 snapshot_root_filesystem( &mut self, vm_id: &str, ) -> Result<RootFilesystemSnapshot, BrowserSidecarError>
pub fn create_layer( &mut self, vm_id: &str, ) -> Result<String, BrowserSidecarError>
pub fn seal_layer( &mut self, vm_id: &str, layer_id: &str, ) -> Result<String, BrowserSidecarError>
pub fn import_snapshot( &mut self, vm_id: &str, entries: &[RootFilesystemEntry], ) -> Result<String, BrowserSidecarError>
pub fn export_snapshot( &mut self, vm_id: &str, layer_id: &str, ) -> Result<RootFilesystemSnapshot, BrowserSidecarError>
pub fn create_overlay( &mut self, vm_id: &str, mode: KernelRootFilesystemMode, upper_layer_id: Option<String>, lower_layer_ids: Vec<String>, ) -> Result<String, BrowserSidecarError>
pub fn register_host_callbacks( &mut self, vm_id: &str, payload: RegisterHostCallbacksRequest, ) -> Result<(String, u32), BrowserSidecarError>
pub fn bootstrap_root_filesystem_entries( &mut self, vm_id: &str, entries: &[RootFilesystemEntry], ) -> Result<u32, BrowserSidecarError>
pub fn guest_filesystem_call( &mut self, vm_id: &str, payload: GuestFilesystemCallRequest, ) -> Result<GuestFilesystemResultResponse, BrowserSidecarError>
pub fn guest_kernel_call( &mut self, vm_id: &str, payload: GuestKernelCallRequest, ) -> Result<GuestKernelResultResponse, BrowserSidecarError>
pub fn kernel_state( &self, vm_id: &str, ) -> Result<LifecycleState, BrowserSidecarError>
pub fn zombie_timer_count( &self, vm_id: &str, ) -> Result<u64, BrowserSidecarError>
pub fn process_snapshot_entries( &self, vm_id: &str, ) -> Result<Vec<SharedProcessSnapshotEntry>, BrowserSidecarError>
pub fn signal_state( &self, vm_id: &str, execution_id: &str, ) -> Result<BTreeMap<u32, ProtocolSignalHandlerRegistration>, BrowserSidecarError>
pub fn find_listener( &self, vm_id: &str, request: &FindListenerRequest, ) -> Result<Option<SocketStateEntry>, BrowserSidecarError>
pub fn find_bound_udp( &self, vm_id: &str, request: &FindBoundUdpRequest, ) -> Result<Option<SocketStateEntry>, BrowserSidecarError>
pub fn vm_fetch( &mut self, vm_id: &str, request: &VmFetchRequest, ) -> Result<String, BrowserSidecarError>
pub fn create_kernel_tcp_listener_for_execution( &mut self, vm_id: &str, execution_id: &str, host: &str, port: u16, backlog: usize, ) -> Result<SocketId, BrowserSidecarError>
pub fn create_kernel_bound_udp_for_execution( &mut self, vm_id: &str, execution_id: &str, host: &str, port: u16, ) -> Result<SocketId, BrowserSidecarError>
pub fn read_execution_stdin( &mut self, vm_id: &str, execution_id: &str, length: usize, timeout: Duration, ) -> Result<Option<Vec<u8>>, BrowserSidecarError>
pub fn dispose_vm(&mut self, vm_id: &str) -> Result<(), 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 start_execution_with_options( &mut self, request: StartExecutionRequest, options: BrowserExecutionOptions, ) -> 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 signal_execution_kernel_process( &mut self, vm_id: &str, execution_id: &str, signal: i32, ) -> Result<(), BrowserSidecarError>
pub fn poll_execution_event( &mut self, request: PollExecutionEventRequest, ) -> Result<Option<ExecutionEvent>, BrowserSidecarError>
Trait Implementations§
Source§impl<B> BrowserExtensionHost for BrowserSidecar<B>
impl<B> BrowserExtensionHost for BrowserSidecar<B>
fn write_file( &mut self, vm_id: &str, path: &str, contents: Vec<u8>, ) -> Result<(), BrowserSidecarError>
fn read_file( &mut self, vm_id: &str, path: &str, ) -> Result<Vec<u8>, BrowserSidecarError>
fn mkdir( &mut self, vm_id: &str, path: &str, recursive: bool, ) -> Result<(), BrowserSidecarError>
fn read_dir( &mut self, vm_id: &str, path: &str, ) -> Result<Vec<String>, BrowserSidecarError>
fn create_javascript_context( &mut self, request: CreateJavascriptContextRequest, ) -> Result<GuestContextHandle, BrowserSidecarError>
fn create_wasm_context( &mut self, request: CreateWasmContextRequest, ) -> Result<GuestContextHandle, BrowserSidecarError>
fn start_execution( &mut self, request: StartExecutionRequest, ) -> Result<StartedExecution, BrowserSidecarError>
fn write_stdin( &mut self, request: WriteExecutionStdinRequest, ) -> Result<(), BrowserSidecarError>
fn close_stdin( &mut self, request: ExecutionHandleRequest, ) -> Result<(), BrowserSidecarError>
fn kill_execution( &mut self, request: KillExecutionRequest, ) -> Result<(), BrowserSidecarError>
fn poll_execution_event( &mut self, request: PollExecutionEventRequest, ) -> Result<Option<ExecutionEvent>, BrowserSidecarError>
Auto Trait Implementations§
impl<B> !RefUnwindSafe for BrowserSidecar<B>
impl<B> !Send for BrowserSidecar<B>
impl<B> !Sync for BrowserSidecar<B>
impl<B> !UnwindSafe for BrowserSidecar<B>
impl<B> Freeze for BrowserSidecar<B>where
B: Freeze,
impl<B> Unpin for BrowserSidecar<B>where
B: Unpin,
impl<B> UnsafeUnpin for BrowserSidecar<B>where
B: UnsafeUnpin,
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