Expand description
§WSLPlugin-rs
This is the main entry point for the WSLPlugin-rs crate, a framework designed for creating plugins for the Windows Subsystem for Linux (WSL) using idiomatic Rust.
§Overview
WSLPlugin-rs simplifies the development of WSL plugins by providing higher-level abstractions built on top of the raw APIs. This crate exports useful modules and types for plugin creation, such as session management, VM handling, and distribution operations.
§Usage
Use the exposed modules and types to build custom WSL plugins. The macro
feature enables the wsl_plugin_v1 attribute, which generates the WSL
Plugin API entry point and hook wiring for a WSLPluginV1 implementation.
The macro can be used without arguments for the base API, with an explicit
minimum version, or with one or more WSLVersionCapability values when the
plugin depends on named API capabilities.
§Example
use wslplugins_rs::prelude::*;
pub(crate) struct MyPlugin {
context: &'static WSLContext,
}
#[wsl_plugin_v1]
impl WSLPluginV1 for MyPlugin {
fn try_new(context: &'static WSLContext) -> WinResult<Self> {
Ok(MyPlugin { context })
}
}Re-exports§
pub use wsl_user_configuration::WSLUserConfiguration;pub use distribution_id::DistributionID;pub use api::WSLCommandExecution;pub use user_distribution_id::UserDistributionID;pub use windows_core;pub use typed_path;pub use wslpluginapi_sys as sys;sys
Modules§
- api
- Provides interfaces for interacting with WSL plugin APIs.
- distribution_
id - Distribution identifiers used by the crate.
- plugin
- Tools and utilities for creating custom WSL plugins.
- prelude
- Convenient re-exports for common plugin development imports. Common imports for building WSL plugins with this crate.
- user_
distribution_ id - wsl_
user_ configuration - Provides types and utilities to interact with WSL (Windows Subsystem for Linux) user configurations.
Structs§
- SessionID
- WSLContext
- A global context for the WSL plugin API.
- WSLDistribution
Information - Represents detailed information about a WSL distribution.
- WSLOffline
Distribution Information - A wrapper around
WslOfflineDistributionInformationproviding a safe interface. - WSLSession
Information - Represents session information for a WSL instance.
- WSLVersion
- Represents a WSL version number.
- WSLVm
Creation Settings - Represents WSL VM creation settings.
Enums§
- Semver
Conversion Error semver - Errors returned when converting a
semver::VersionintoWSLVersion. - WSLVersion
Capability - WSL Plugin API capabilities that are only available from a specific API version.
- WSLVersion
Parse Error - Errors returned when parsing a
super::WSLVersionfrom text.
Traits§
- CoreWSL
Distribution Information - A trait representing the core information of a WSL distribution.
- HasSession
Id
Attribute Macros§
- wsl_
plugin_ v1 macro - Re-exports procedural macros when the
macrofeature is enabled.