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. Conditional features like macro
enable procedural macros for simplifying the plugin development process.
§Example
#[cfg(feature = "macro")]
use wslplugins_rs::prelude::*;
pub(crate) struct MyPlugin {
context: &'static WSLContext,
}
#[wsl_plugin_v1(2, 0, 5)]
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 - Module
DistributionID - 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§
- Distribution
Information - Represents detailed information about a WSL distribution.
- Offline
Distribution Information - A wrapper around
WslOfflineDistributionInformationproviding a safe interface. - SessionID
- WSLContext
- A global context for the WSL plugin API.
- WSLSession
Information - Represents session information for a WSL instance.
- WSLVersion
- Represents a WSL version number.
- WSLVm
Creation Settings - Represents WSL VM creation settings.
Traits§
- Core
Distribution Information - A trait representing the core information of a WSL distribution.
Attribute Macros§
- wsl_
plugin_ v1 macro - Re-exports procedural macros when the
macrofeature is enabled. It allow to mark a plugin struct (that implementWSLPluginV1trait) to be easely integrated to the WSL plugin system without writing manually C code for entry point or hooks. Attribute macro for WSL plugin V1. This macro should be used on impl block ofWSLPluginV1in order to register the plugin that implement this interface