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
Source§fn min_nginx_version(&self) -> Option<&str>
fn min_nginx_version(&self) -> Option<&str>
Minimum nginx version this rule applies to (inclusive). Read more
Source§fn max_nginx_version(&self) -> Option<&str>
fn max_nginx_version(&self) -> Option<&str>
Maximum nginx version this rule applies to (inclusive). Read more
Source§fn check_with_serialized_config(
&self,
config: &Config,
path: &Path,
_serialized_config: &str,
) -> Vec<LintError>
fn check_with_serialized_config( &self, config: &Config, path: &Path, _serialized_config: &str, ) -> Vec<LintError>
👎Deprecated since 0.16.0:
no longer called by the linter; the serialized config was only used by legacy core-module plugins. Implement check() or check_shared() instead.
Check with pre-serialized config JSON (optimization for WASM plugins) Read more
Whether this rule wants the config as a shared
Arc handle. Read moreRun the rule with a shared config handle. Read more
Source§fn wants_content(&self) -> bool
fn wants_content(&self) -> bool
Whether this rule wants the raw file content directly. Read more
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