pub struct BridgeAdapter { /* private fields */ }Expand description
Bridge adapter that proxies DAP messages to Perl::LanguageServer
This adapter spawns Perl::LanguageServer in DAP mode and forwards all DAP protocol messages bidirectionally via stdio.
Implementations§
Source§impl BridgeAdapter
impl BridgeAdapter
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new bridge adapter
§Examples
use perl_dap::BridgeAdapter;
let adapter = BridgeAdapter::new();Sourcepub fn with_env_config(env_config: DapBridgeEnvConfig) -> Self
pub fn with_env_config(env_config: DapBridgeEnvConfig) -> Self
Create a bridge adapter with an explicit subprocess environment policy.
Sourcepub async fn spawn_pls_dap(&mut self) -> Result<()>
pub async fn spawn_pls_dap(&mut self) -> Result<()>
Spawn Perl::LanguageServer in DAP mode
This method starts the Perl::LanguageServer process with DAP protocol support. It uses the platform-specific perl binary resolution.
§Errors
Returns an error if:
- Perl binary cannot be found on PATH
- Perl::LanguageServer module is not installed
- Process spawn fails
§Examples
use perl_dap::BridgeAdapter;
let mut adapter = BridgeAdapter::new();
adapter.spawn_pls_dap().await?;Sourcepub async fn proxy_messages(&mut self) -> Result<()>
pub async fn proxy_messages(&mut self) -> Result<()>
Proxy messages between VS Code and Perl::LanguageServer
This method forwards stdin/stdout bidirectionally between the DAP client and the Perl::LanguageServer process.
§Errors
Returns an error if:
- Child process not spawned (call
spawn_pls_dap()first) - I/O error during message proxying
§Examples
use perl_dap::BridgeAdapter;
let mut adapter = BridgeAdapter::new();
adapter.spawn_pls_dap().await?;
adapter.proxy_messages().await?;
adapter.shutdown().await?;Trait Implementations§
Source§impl Default for BridgeAdapter
impl Default for BridgeAdapter
Source§impl Drop for BridgeAdapter
impl Drop for BridgeAdapter
Auto Trait Implementations§
impl !RefUnwindSafe for BridgeAdapter
impl !UnwindSafe for BridgeAdapter
impl Freeze for BridgeAdapter
impl Send for BridgeAdapter
impl Sync for BridgeAdapter
impl Unpin for BridgeAdapter
impl UnsafeUnpin for BridgeAdapter
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