Skip to main content

BrowserSidecar

Struct BrowserSidecar 

Source
pub struct BrowserSidecar<B> { /* private fields */ }

Implementations§

Source§

impl<B> BrowserSidecar<B>

Source

pub fn new(bridge: B, config: BrowserSidecarConfig) -> Self

Source

pub fn with_extensions( bridge: B, config: BrowserSidecarConfig, extensions: Vec<Box<dyn BrowserExtension>>, ) -> Result<Self, BrowserSidecarError>

Source

pub fn register_extension( &mut self, extension: Box<dyn BrowserExtension>, ) -> Result<(), BrowserSidecarError>

Source

pub fn extension_count(&self) -> usize

Source

pub fn has_extension(&self, namespace: &str) -> bool

Source

pub fn dispatch_extension_request( &mut self, request: BrowserExtensionRequest, ) -> Result<BrowserExtensionResponse, BrowserSidecarError>

Source

pub fn sidecar_id(&self) -> &str

Source

pub fn bridge(&self) -> &B

Source

pub fn bridge_mut(&mut self) -> &mut B

Source

pub fn into_bridge(self) -> B

Source

pub fn vm_count(&self) -> usize

Source

pub fn context_count(&self, vm_id: &str) -> usize

Source

pub fn active_worker_count(&self, vm_id: &str) -> usize

Source

pub fn create_vm( &mut self, config: KernelVmConfig, ) -> Result<(), BrowserSidecarError>

Source

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>

Source

pub fn create_vm_with_root_filesystem( &mut self, config: KernelVmConfig, root_filesystem: RootFilesystemConfig, ) -> Result<(), BrowserSidecarError>

Source

pub fn write_file( &mut self, vm_id: &str, path: &str, contents: impl Into<Vec<u8>>, ) -> Result<(), BrowserSidecarError>

Source

pub fn read_file( &mut self, vm_id: &str, path: &str, ) -> Result<Vec<u8>, BrowserSidecarError>

Source

pub fn mkdir( &mut self, vm_id: &str, path: &str, recursive: bool, ) -> Result<(), BrowserSidecarError>

Source

pub fn read_dir( &mut self, vm_id: &str, path: &str, ) -> Result<Vec<String>, BrowserSidecarError>

Source

pub fn snapshot_root_filesystem( &mut self, vm_id: &str, ) -> Result<RootFilesystemSnapshot, BrowserSidecarError>

Source

pub fn create_layer( &mut self, vm_id: &str, ) -> Result<String, BrowserSidecarError>

Source

pub fn seal_layer( &mut self, vm_id: &str, layer_id: &str, ) -> Result<String, BrowserSidecarError>

Source

pub fn import_snapshot( &mut self, vm_id: &str, entries: &[RootFilesystemEntry], ) -> Result<String, BrowserSidecarError>

Source

pub fn export_snapshot( &mut self, vm_id: &str, layer_id: &str, ) -> Result<RootFilesystemSnapshot, BrowserSidecarError>

Source

pub fn create_overlay( &mut self, vm_id: &str, mode: KernelRootFilesystemMode, upper_layer_id: Option<String>, lower_layer_ids: Vec<String>, ) -> Result<String, BrowserSidecarError>

Source

pub fn register_host_callbacks( &mut self, vm_id: &str, payload: RegisterHostCallbacksRequest, ) -> Result<(String, u32), BrowserSidecarError>

Source

pub fn bootstrap_root_filesystem_entries( &mut self, vm_id: &str, entries: &[RootFilesystemEntry], ) -> Result<u32, BrowserSidecarError>

Source

pub fn guest_filesystem_call( &mut self, vm_id: &str, payload: GuestFilesystemCallRequest, ) -> Result<GuestFilesystemResultResponse, BrowserSidecarError>

Source

pub fn guest_kernel_call( &mut self, vm_id: &str, payload: GuestKernelCallRequest, ) -> Result<GuestKernelResultResponse, BrowserSidecarError>

Source

pub fn kernel_state( &self, vm_id: &str, ) -> Result<LifecycleState, BrowserSidecarError>

Source

pub fn zombie_timer_count( &self, vm_id: &str, ) -> Result<u64, BrowserSidecarError>

Source

pub fn process_snapshot_entries( &self, vm_id: &str, ) -> Result<Vec<SharedProcessSnapshotEntry>, BrowserSidecarError>

Source

pub fn signal_state( &self, vm_id: &str, execution_id: &str, ) -> Result<BTreeMap<u32, ProtocolSignalHandlerRegistration>, BrowserSidecarError>

Source

pub fn find_listener( &self, vm_id: &str, request: &FindListenerRequest, ) -> Result<Option<SocketStateEntry>, BrowserSidecarError>

Source

pub fn find_bound_udp( &self, vm_id: &str, request: &FindBoundUdpRequest, ) -> Result<Option<SocketStateEntry>, BrowserSidecarError>

Source

pub fn vm_fetch( &mut self, vm_id: &str, request: &VmFetchRequest, ) -> Result<String, BrowserSidecarError>

Source

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>

Source

pub fn create_kernel_bound_udp_for_execution( &mut self, vm_id: &str, execution_id: &str, host: &str, port: u16, ) -> Result<SocketId, BrowserSidecarError>

Source

pub fn read_execution_stdin( &mut self, vm_id: &str, execution_id: &str, length: usize, timeout: Duration, ) -> Result<Option<Vec<u8>>, BrowserSidecarError>

Source

pub fn dispose_vm(&mut self, vm_id: &str) -> Result<(), BrowserSidecarError>

Source

pub fn create_javascript_context( &mut self, request: CreateJavascriptContextRequest, ) -> Result<GuestContextHandle, BrowserSidecarError>

Source

pub fn create_wasm_context( &mut self, request: CreateWasmContextRequest, ) -> Result<GuestContextHandle, BrowserSidecarError>

Source

pub fn start_execution( &mut self, request: StartExecutionRequest, ) -> Result<StartedExecution, BrowserSidecarError>

Source

pub fn start_execution_with_options( &mut self, request: StartExecutionRequest, options: BrowserExecutionOptions, ) -> Result<StartedExecution, BrowserSidecarError>

Source

pub fn write_stdin( &mut self, request: WriteExecutionStdinRequest, ) -> Result<(), BrowserSidecarError>

Source

pub fn close_stdin( &mut self, request: ExecutionHandleRequest, ) -> Result<(), BrowserSidecarError>

Source

pub fn kill_execution( &mut self, request: KillExecutionRequest, ) -> Result<(), BrowserSidecarError>

Source

pub fn signal_execution_kernel_process( &mut self, vm_id: &str, execution_id: &str, signal: i32, ) -> Result<(), BrowserSidecarError>

Source

pub fn poll_execution_event( &mut self, request: PollExecutionEventRequest, ) -> Result<Option<ExecutionEvent>, BrowserSidecarError>

Trait Implementations§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more