pub struct NativePluginRule<P: Plugin> { /* private fields */ }Expand description
Adapter that wraps a Plugin implementation into a LintRule.
This allows running WASM plugin code natively, bypassing the serialization/deserialization and WASM VM overhead.
Implementations§
Source§impl<P: Plugin> NativePluginRule<P>
impl<P: Plugin> NativePluginRule<P>
pub fn new() -> Self
Sourcepub fn with_plugin(plugin: P) -> Self
pub fn with_plugin(plugin: P) -> Self
Create a NativePluginRule with a pre-configured plugin instance
Trait Implementations§
Source§impl<P: Plugin> Default for NativePluginRule<P>
impl<P: Plugin> Default for NativePluginRule<P>
Source§impl<P: Plugin + Send + Sync> LintRule for NativePluginRule<P>
impl<P: Plugin + Send + Sync> LintRule for NativePluginRule<P>
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Unique identifier for this rule (e.g.
"server-tokens-enabled").Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
One-line human-readable description of what this rule checks.
Source§fn check(&self, config: &Config, path: &Path) -> Vec<CommonLintError>
fn check(&self, config: &Config, path: &Path) -> Vec<CommonLintError>
Run the rule against
config (parsed from path) and return diagnostics.Source§fn bad_example(&self) -> Option<&str>
fn bad_example(&self) -> Option<&str>
Get example of bad configuration
Source§fn good_example(&self) -> Option<&str>
fn good_example(&self) -> Option<&str>
Get example of good configuration
Auto Trait Implementations§
impl<P> Freeze for NativePluginRule<P>where
P: Freeze,
impl<P> RefUnwindSafe for NativePluginRule<P>where
P: RefUnwindSafe,
impl<P> Send for NativePluginRule<P>where
P: Send,
impl<P> Sync for NativePluginRule<P>where
P: Sync,
impl<P> Unpin for NativePluginRule<P>where
P: Unpin,
impl<P> UnsafeUnpin for NativePluginRule<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for NativePluginRule<P>where
P: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more