Skip to content

A simple rust ffi binding for Microsoft.WSL.PluginApi nuget package. This is used in the wslplugins-rs project.

License

Notifications You must be signed in to change notification settings

mveril/wslpluginapi-sys

Repository files navigation

wslpluginapi-sys

Crates.io
Docs.rs
Build Status
License
Native API version
Platform

wslpluginapi-sys is a Rust crate that provides low-level bindings to the Windows Subsystem for Linux (WSL) Plugin API. It offers a direct interface to the functions and structures defined in the WSL Plugin API, facilitating the development of WSL plugins in Rust.

Features

  • Comprehensive Bindings: Provides complete bindings to the WSL Plugin API, including structures like WSLPluginAPIV1 or WSLPluginHooksV1 and other essential components.
  • Unsafe Abstractions: Direct, unsafe bindings closely mirroring the original C API for maximum control and flexibility.

Prerequisites

Before using wslpluginapi-sys, ensure you have the following installed:

  • Rust: Latest stable version.

Optional

  • NuGet: Use the NuGet CLI in the xtask nuget process to download NuGet (if not present, we use reqwest to do this process).

Installation

Add wslpluginapi-sys to your Cargo.toml:

[dependencies]
wslpluginapi-sys = "0.1.0-beta.4+2.4.4"

Safety

This crate provides unsafe bindings that closely follow the original C API. Users must ensure they uphold the necessary safety invariants when interacting with these bindings. Proper handling of pointers, memory management, and adherence to the API's expected usage patterns are crucial.

NuGet package dependency

This project depends on a third-party dependency called Microsoft.WSL.PluginApi from Microsoft, available on NuGet and providing bindings for it. To upgrade it, change the version build metadata of the project and run cargo xtask nuget (don't forget to commit changes generated from the xtask). This xtask extracts all the needed content from the NuGet package. For more info see THIRD-PARTY-NOTICES.md

License

This project is licensed under the MIT License. See the LICENSE file for details.

Note: This crate is part of the WSLPlugins-rs project, which aims to create an idiomatic Rust framework for developing WSL plugins.

About

A simple rust ffi binding for Microsoft.WSL.PluginApi nuget package. This is used in the wslplugins-rs project.

Topics

Resources

License

Stars

Watchers

Forks

Languages