pub struct ExtensionManager<C: ExtensionSpec> { /* private fields */ }Expand description
Owns MCP connections, scoped slots, and their advertised leases.
Implementations§
Source§impl<C: ExtensionSpec> ExtensionManager<C>
impl<C: ExtensionSpec> ExtensionManager<C>
pub fn new( host: Arc<dyn ExtensionHost<C>>, action_required: Arc<ActionRequiredManager>, default_client: ClientContext, ) -> Self
Sourcepub fn attach_client(&self, session_id: &str, client: ClientContext)
pub fn attach_client(&self, session_id: &str, client: ClientContext)
The latest client to attach to a session is the one its extensions start for from then on.
pub fn client(&self, session_id: &str) -> Arc<ClientContext> ⓘ
pub async fn resolve( self: &Arc<Self>, set: &ExtensionSet<C>, ) -> ExtensionLease<C>
Sourcepub async fn enable(
self: &Arc<Self>,
scope_id: &str,
config: C,
working_dir: &Path,
container: Option<&Container>,
commit: impl Future<Output = ExtensionResult<()>>,
) -> ExtensionResult<()>
pub async fn enable( self: &Arc<Self>, scope_id: &str, config: C, working_dir: &Path, container: Option<&Container>, commit: impl Future<Output = ExtensionResult<()>>, ) -> ExtensionResult<()>
Start the extension and keep it pending until commit selects it, so a
failure reaches whoever asked and the selection is only changed when it
starts. A concurrent enable of the same config waits on the same start.
Auto Trait Implementations§
impl<C> !Freeze for ExtensionManager<C>
impl<C> !RefUnwindSafe for ExtensionManager<C>
impl<C> !UnwindSafe for ExtensionManager<C>
impl<C> Forget for ExtensionManager<C>
impl<C> Move for ExtensionManager<C>
impl<C> Send for ExtensionManager<C>
impl<C> Sync for ExtensionManager<C>
impl<C> Unpin for ExtensionManager<C>
impl<C> UnsafeUnpin for ExtensionManager<C>where
Mutex<HashMap<String, IndexMap<String, Arc<ExtensionSlot<C>>>>>: UnsafeUnpin,
Mutex<HashMap<(String, String), Arc<ExtensionSlot<C>>>>: UnsafeUnpin,
Arc<dyn ExtensionHost<C>>: 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
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> 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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.