pub struct DapPlugin { /* private fields */ }Expand description
Plugin providing Debug Adapter Protocol integration for agents.
Manages debug adapter client lifecycles, registers DAP tools into the agent’s tool registry, and routes debug events (stopped, terminated) as signals.
Implementations§
Source§impl DapPlugin
impl DapPlugin
Sourcepub fn new(config: DapPluginConfig) -> Self
pub fn new(config: DapPluginConfig) -> Self
Create a new DAP plugin with the given configuration.
The plugin starts with no active clients. Use start_adapter
to spawn debug adapter processes.
Sourcepub fn with_registry(
config: DapPluginConfig,
registry: DebugAdapterRegistry,
) -> Self
pub fn with_registry( config: DapPluginConfig, registry: DebugAdapterRegistry, ) -> Self
Create a plugin with a custom adapter registry.
Sourcepub async fn start_adapter(
&mut self,
session_id: &str,
adapter_config: &DapAdapterConfig,
) -> Result<Arc<DapClient>, DapError>
pub async fn start_adapter( &mut self, session_id: &str, adapter_config: &DapAdapterConfig, ) -> Result<Arc<DapClient>, DapError>
Sourcepub async fn client(&self, session_id: &str) -> Option<Arc<DapClient>>
pub async fn client(&self, session_id: &str) -> Option<Arc<DapClient>>
Get a client by session ID.
Sourcepub async fn disconnect_all(&self)
pub async fn disconnect_all(&self)
Disconnect all active sessions (called on plugin shutdown).
Sourcepub fn registry(&self) -> &DebugAdapterRegistry
pub fn registry(&self) -> &DebugAdapterRegistry
Access the adapter registry.
Sourcepub const fn config(&self) -> &DapPluginConfig
pub const fn config(&self) -> &DapPluginConfig
Access the plugin configuration.
Trait Implementations§
Source§impl Plugin for DapPlugin
impl Plugin for DapPlugin
Source§fn signal_routes(&self) -> Vec<SignalRoute>
fn signal_routes(&self) -> Vec<SignalRoute>
Signal routes contributed by this plugin.
Source§fn on_user_message<'a>(
&'a self,
_input: &'a PluginInput,
_state: &'a PluginStateMap,
) -> Pin<Box<dyn Future<Output = Vec<Directive>> + Send + 'a>>
fn on_user_message<'a>( &'a self, _input: &'a PluginInput, _state: &'a PluginStateMap, ) -> Pin<Box<dyn Future<Output = Vec<Directive>> + Send + 'a>>
Called when a user message arrives.
Source§fn on_event<'a>(
&'a self,
_event: &'a AgentEvent,
_state: &'a PluginStateMap,
) -> Pin<Box<dyn Future<Output = Vec<Directive>> + Send + 'a>>
fn on_event<'a>( &'a self, _event: &'a AgentEvent, _state: &'a PluginStateMap, ) -> Pin<Box<dyn Future<Output = Vec<Directive>> + Send + 'a>>
Called when an agent event is emitted.
Source§fn before_run<'a>(
&'a self,
_state: &'a PluginStateMap,
) -> Pin<Box<dyn Future<Output = Vec<Directive>> + Send + 'a>>
fn before_run<'a>( &'a self, _state: &'a PluginStateMap, ) -> Pin<Box<dyn Future<Output = Vec<Directive>> + Send + 'a>>
Called before each agent run loop iteration.
Auto Trait Implementations§
impl Freeze for DapPlugin
impl !RefUnwindSafe for DapPlugin
impl Send for DapPlugin
impl Sync for DapPlugin
impl Unpin for DapPlugin
impl UnsafeUnpin for DapPlugin
impl !UnwindSafe for DapPlugin
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<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> 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