1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Provides procedural macros for WSL plugin development.
use TokenStream;
/// Attribute macro for WSL plugin V1.
///
/// This macro should be used on an `impl WSLPluginV1` block to register a
/// plugin implementation and generate the WSL Plugin API entry point.
///
/// The attribute accepts one of these required version forms:
///
/// - `#[wsl_plugin_v1]`, which does not require a specific minimum WSL Plugin
/// API version beyond the entry point being available.
/// - `#[wsl_plugin_v1(major, minor)]`, which requires `major.minor.0`.
/// - `#[wsl_plugin_v1(major, minor, revision)]`, which requires the exact
/// `major.minor.revision` minimum version.
/// - `#[wsl_plugin_v1(capability)]` or
/// `#[wsl_plugin_v1(capability_a | capability_b)]`, which requires the
/// minimum version for the listed
/// [`WSLVersionCapability`](https://docs.rs/wslplugins-rs/latest/wslplugins_rs/enum.WSLVersionCapability.html)
/// value or values.
///
/// # Minimum version example
/// ```rust, ignore
/// #[wsl_plugin_v1]
/// impl WSLPluginV1 for MyPlugin {
/// // Implementation details
/// }
/// ```
///
/// # Explicit version example
/// ```rust, ignore
/// #[wsl_plugin_v1(2, 1, 3)]
/// impl WSLPluginV1 for MyPlugin {
/// // Implementation details
/// }
/// ```
///
/// # Capability example
///
/// This example uses
/// [`WSLVersionCapability::DistributionRegisteredHook`](https://docs.rs/wslplugins-rs/latest/wslplugins_rs/enum.WSLVersionCapability.html#variant.DistributionRegisteredHook)
/// (`2.1.2`) and
/// [`WSLVersionCapability::DistributionUnregisteredHook`](https://docs.rs/wslplugins-rs/latest/wslplugins_rs/enum.WSLVersionCapability.html#variant.DistributionUnregisteredHook)
/// (`2.1.2`).
///
/// ```rust, ignore
/// #[wsl_plugin_v1(
/// WSLVersionCapability::DistributionRegisteredHook
/// | WSLVersionCapability::DistributionUnregisteredHook
/// )]
/// impl WSLPluginV1 for MyPlugin {
/// // Implementation details
/// }
/// ```