pub struct PluginValidator { /* private fields */ }Expand description
Advanced plugin validation framework with security analysis
The PluginValidator provides comprehensive validation of plugins including metadata validation, security analysis, dependency checking, code safety validation, and trust verification.
§Examples
use sklears_core::plugin::{PluginValidator, PluginManifest};
let validator = PluginValidator::new();
// Validate a plugin comprehensively
// let report = validator.validate_comprehensive(&plugin, &manifest)?;
//
// Check validation results
// if report.has_errors() {
// println!("Validation failed: {:?}", report.get_errors());
// } else {
// println!("Plugin validation passed");
// }Implementations§
Source§impl PluginValidator
impl PluginValidator
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new plugin validator
Initializes a new validator with default security policies and validation components.
Sourcepub fn with_security_policy(security_policy: SecurityPolicy) -> Self
pub fn with_security_policy(security_policy: SecurityPolicy) -> Self
Create a validator with custom security policy
§Arguments
security_policy- Custom security policy to use
Sourcepub fn validate_comprehensive(
&self,
plugin: &dyn Plugin,
manifest: &PluginManifest,
) -> Result<ValidationReport>
pub fn validate_comprehensive( &self, plugin: &dyn Plugin, manifest: &PluginManifest, ) -> Result<ValidationReport>
Perform comprehensive plugin validation
This method performs all validation checks including basic metadata validation, security analysis, dependency checking, code safety validation, and trust verification.
§Arguments
plugin- The plugin to validatemanifest- The plugin manifest with detailed information
§Returns
A validation report containing all findings, errors, and warnings.
Trait Implementations§
Source§impl Debug for PluginValidator
impl Debug for PluginValidator
Auto Trait Implementations§
impl Freeze for PluginValidator
impl RefUnwindSafe for PluginValidator
impl Send for PluginValidator
impl Sync for PluginValidator
impl Unpin for PluginValidator
impl UnwindSafe for PluginValidator
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more