pub struct ExtensionHostImpl {
config: HostConfig,
transport: Transport,
extension_manager: Arc<ExtensionManagerImpl>,
activation_engine: Arc<ActivationEngine>,
wasm_runtime: Arc<WASMRuntime>,
active_extensions: Arc<RwLock<Vec<String>>>,
state: Arc<RwLock<HostState>>,
}Expand description
Main extension host controller
Fields§
§config: HostConfigHost configuration
transport: TransportTransport for communication
extension_manager: Arc<ExtensionManagerImpl>Extension manager
activation_engine: Arc<ActivationEngine>Activation engine
wasm_runtime: Arc<WASMRuntime>WASM runtime
active_extensions: Arc<RwLock<Vec<String>>>Active extensions
state: Arc<RwLock<HostState>>Host state
Implementations§
Source§impl ExtensionHostImpl
impl ExtensionHostImpl
Sourcepub async fn with_config(
transport: Transport,
config: HostConfig,
) -> Result<Self>
pub async fn with_config( transport: Transport, config: HostConfig, ) -> Result<Self>
Create a new extension host with custom configuration
Sourcepub async fn load_extension(&self, path: &PathBuf) -> Result<String>
pub async fn load_extension(&self, path: &PathBuf) -> Result<String>
Load an extension from a path
Sourcepub async fn unload_extension(&self, extension_id: &str) -> Result<()>
pub async fn unload_extension(&self, extension_id: &str) -> Result<()>
Unload an extension
Sourcepub async fn deactivate(&self, extension_id: &str) -> Result<()>
pub async fn deactivate(&self, extension_id: &str) -> Result<()>
Deactivate an extension
Sourcepub async fn activate_all(&self) -> Result<Vec<String>>
pub async fn activate_all(&self) -> Result<Vec<String>>
Activate all loaded extensions
Sourcepub async fn deactivate_all(&self) -> Result<()>
pub async fn deactivate_all(&self) -> Result<()>
Deactivate all active extensions
Sourcepub fn extension_manager(&self) -> &Arc<ExtensionManagerImpl>
pub fn extension_manager(&self) -> &Arc<ExtensionManagerImpl>
Get the extension manager
Sourcepub fn activation_engine(&self) -> &Arc<ActivationEngine>
pub fn activation_engine(&self) -> &Arc<ActivationEngine>
Get the activation engine
Sourcepub fn wasm_runtime(&self) -> &Arc<WASMRuntime>
pub fn wasm_runtime(&self) -> &Arc<WASMRuntime>
Get the WASM runtime
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExtensionHostImpl
impl !RefUnwindSafe for ExtensionHostImpl
impl Send for ExtensionHostImpl
impl Sync for ExtensionHostImpl
impl Unpin for ExtensionHostImpl
impl !UnwindSafe for ExtensionHostImpl
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request