wslcsdk
Idiomatic, safe, and asynchronous Rust SDK for Microsoft WSL Containers (WSLC).
Built against Microsoft's official Microsoft.WSL.Containers (Version 3.0.1 GA), this crate provides modern, memory-safe, and production-grade Rust interfaces to manage WSL-native micro-VM containers.
Features
- Strict RAII Lifetime Management: Automatically closes native C handles (
WslcSession,WslcContainer,WslcProcess,WslcCrashDumpSubscription) upon drop. - Tokio Streaming Process I/O: Captures stdout/stderr via native C trampolines and feeds them into bounded asynchronous channels.
- Typed Error Domain: Maps Windows HRESULTs and wide-string error messages into typed
WslcErrorvariants. - Non-blocking Async Extensions: Provides
_asyncmethods offloaded totokio::task::spawn_blockingwith COM MTA automatic initialization. - Volume and Image Management: Built-in VHD volume options and image pull/list/delete abstractions.
Installation
Add this crate to your Cargo.toml:
[]
= "0.1.0"
= { = "1", = ["full"] }
Compatibility:
wslcsdk 0.1.xis built on top ofwslcsdk-sys 3.0.1and requires Windows 10/11 with WSL 2.9.3+ or 3.0.1+.
Usage Example
use ;
async
License
This project is licensed under the MIT License.