pub struct ExtensionHost { /* private fields */ }Expand description
A validated, process-isolated extension host boundary.
Implementations§
Source§impl ExtensionHost
impl ExtensionHost
Sourcepub fn new(
root: impl AsRef<Path>,
registry: ExtensionRegistry,
) -> Result<Self, ExtensionError>
pub fn new( root: impl AsRef<Path>, registry: ExtensionRegistry, ) -> Result<Self, ExtensionError>
Create a host whose entrypoints must remain below root.
Sourcepub fn with_experimental_extensions(self) -> Self
pub fn with_experimental_extensions(self) -> Self
Opt into the experimental extension capability for this host.
Invocations still require a detected native sandbox. This opt-in does not authorize the unsandboxed subprocess helper.
Sourcepub fn sandbox(&self) -> ExtensionSandbox
pub fn sandbox(&self) -> ExtensionSandbox
Report the sandbox that an explicit guarded invocation would use.
Sourcepub async fn invoke_sandboxed(
&self,
extension_id: &str,
capability: ExtensionCapability,
host: &str,
action: &str,
payload: Value,
) -> Result<Value, ExtensionError>
pub async fn invoke_sandboxed( &self, extension_id: &str, capability: ExtensionCapability, host: &str, action: &str, payload: Value, ) -> Result<Value, ExtensionError>
Invoke one extension only inside the detected native sandbox.
Sourcepub async fn invoke_guarded(
&self,
session: &BrowserSession,
extension_id: &str,
capability: ExtensionCapability,
host: &str,
action: &str,
payload: Value,
) -> Result<ActionOutcome, ExtensionError>
pub async fn invoke_guarded( &self, session: &BrowserSession, extension_id: &str, capability: ExtensionCapability, host: &str, action: &str, payload: Value, ) -> Result<ActionOutcome, ExtensionError>
Invoke an extension and dispatch its returned action through the core revision-guarded browser methods.
The extension may suggest only click, type, clear, check,
uncheck, or select. The returned request must include the current
observation revision. Policy checks, target resolution, verification,
and effect recording remain owned by BrowserSession.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExtensionHost
impl RefUnwindSafe for ExtensionHost
impl Send for ExtensionHost
impl Sync for ExtensionHost
impl Unpin for ExtensionHost
impl UnsafeUnpin for ExtensionHost
impl UnwindSafe for ExtensionHost
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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