pub struct PluginConfig {
pub plugin_dir: PathBuf,
pub config_dir: PathBuf,
pub enabled: bool,
pub default_timeout_ms: u64,
pub max_memory_mb: usize,
pub allow_network: bool,
pub disabled_plugins: HashSet<String>,
pub fs_read_roots: Vec<PathBuf>,
}Expand description
Global plugin system configuration.
Fields§
§plugin_dir: PathBufDirectory where plugins are stored.
config_dir: PathBufDirectory for plugin configuration files.
enabled: boolWhether to enable the plugin system.
default_timeout_ms: u64Default timeout for plugin operations in milliseconds.
max_memory_mb: usizeMaximum memory per plugin in MB (0 = unlimited).
allow_network: boolWhether to allow plugins to access the network.
disabled_plugins: HashSet<String>List of disabled plugin names.
fs_read_roots: Vec<PathBuf>Directories the plugin filesystem API may read from (e.g. the scan root). Empty means the filesystem API denies all reads (the safe default).
Implementations§
Source§impl PluginConfig
impl PluginConfig
Sourcepub fn with_plugin_dir(self, dir: PathBuf) -> Self
pub fn with_plugin_dir(self, dir: PathBuf) -> Self
Create a new config with a custom plugin directory.
Sourcepub fn with_timeout(self, timeout_ms: u64) -> Self
pub fn with_timeout(self, timeout_ms: u64) -> Self
Set the default timeout.
Sourcepub fn disable_plugin(self, name: impl Into<String>) -> Self
pub fn disable_plugin(self, name: impl Into<String>) -> Self
Disable a specific plugin.
Sourcepub fn is_disabled(&self, name: &str) -> bool
pub fn is_disabled(&self, name: &str) -> bool
Check if a plugin is disabled.
Sourcepub fn with_fs_read_roots(self, roots: Vec<PathBuf>) -> Self
pub fn with_fs_read_roots(self, roots: Vec<PathBuf>) -> Self
Set the directories the plugin filesystem API may read from.
Trait Implementations§
Source§impl Clone for PluginConfig
impl Clone for PluginConfig
Source§impl Debug for PluginConfig
impl Debug for PluginConfig
Source§impl Default for PluginConfig
impl Default for PluginConfig
Source§impl<'de> Deserialize<'de> for PluginConfig
impl<'de> Deserialize<'de> for PluginConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PluginConfig
impl RefUnwindSafe for PluginConfig
impl Send for PluginConfig
impl Sync for PluginConfig
impl Unpin for PluginConfig
impl UnsafeUnpin for PluginConfig
impl UnwindSafe for PluginConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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