pub struct PluginConfig {
pub enabled: bool,
pub hook_timeout_ms: u64,
pub paths: Vec<String>,
pub continue_on_error: bool,
pub hooks: HookConfig,
pub trust_local: bool,
}Expand description
Plugin system configuration from hx.toml [plugins] section.
Fields§
§enabled: boolWhether plugins are enabled.
hook_timeout_ms: u64Timeout for hook execution in milliseconds.
paths: Vec<String>Additional paths to search for plugins.
continue_on_error: boolWhether to continue on hook failure.
hooks: HookConfigHook configuration.
trust_local: boolWhether project-local plugins (.hx/plugins) may be loaded.
Never read from the manifest: local plugins run arbitrary code, so the project that ships them cannot be the one to authorize them. The CLI sets this after checking the user’s trust list in the global config.
Implementations§
Source§impl PluginConfig
impl PluginConfig
Sourcepub fn local_plugins_dir(project_root: &Path) -> PathBuf
pub fn local_plugins_dir(project_root: &Path) -> PathBuf
Path to a project’s local plugins directory.
Sourcepub fn hook_timeout(&self) -> Duration
pub fn hook_timeout(&self) -> Duration
Get the timeout as a Duration.
Sourcepub fn all_paths(&self, project_root: &Path) -> Vec<PathBuf>
pub fn all_paths(&self, project_root: &Path) -> Vec<PathBuf>
Get all plugin search paths, including defaults.
The project-local directory is only included when the project has been
trusted (see PluginConfig::trust_local).
Sourcepub fn scripts_for_hook(&self, event: HookEvent) -> &[String]
pub fn scripts_for_hook(&self, event: HookEvent) -> &[String]
Get scripts for a specific hook event.
Trait Implementations§
Source§impl Clone for PluginConfig
impl Clone for PluginConfig
Source§fn clone(&self) -> PluginConfig
fn clone(&self) -> PluginConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PluginConfig
impl Debug for PluginConfig
Source§impl Default for PluginConfig
impl Default for PluginConfig
Source§fn default() -> PluginConfig
fn default() -> PluginConfig
Source§impl<'de> Deserialize<'de> for PluginConfigwhere
PluginConfig: Default,
impl<'de> Deserialize<'de> for PluginConfigwhere
PluginConfig: Default,
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>,
Source§impl From<PluginConfig> for PluginConfig
impl From<PluginConfig> for PluginConfig
Source§fn from(config: PluginConfig) -> Self
fn from(config: PluginConfig) -> Self
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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