pub struct PluginContext {
pub project_root: PathBuf,
pub project_name: String,
pub ghc_version: Option<String>,
pub cabal_file: Option<PathBuf>,
pub build: Option<BuildContext>,
pub test: Option<TestContext>,
pub env_vars: HashMap<String, String>,
pub verbose: bool,
}Expand description
Context available during plugin execution.
Fields§
§project_root: PathBufProject root directory.
project_name: StringProject name from hx.toml or cabal file.
ghc_version: Option<String>GHC version (if detected).
cabal_file: Option<PathBuf>Cabal file path (if found).
build: Option<BuildContext>Build context (for post-build hooks).
test: Option<TestContext>Test context (for post-test hooks).
env_vars: HashMap<String, String>Environment variables to set for child processes.
verbose: boolWhether verbose output is enabled.
Implementations§
Source§impl PluginContext
impl PluginContext
Sourcepub fn with_ghc_version(self, version: impl Into<String>) -> Self
pub fn with_ghc_version(self, version: impl Into<String>) -> Self
Set the GHC version.
Sourcepub fn with_cabal_file(self, path: impl Into<PathBuf>) -> Self
pub fn with_cabal_file(self, path: impl Into<PathBuf>) -> Self
Set the cabal file path.
Sourcepub fn with_build_context(self, build: BuildContext) -> Self
pub fn with_build_context(self, build: BuildContext) -> Self
Set the build context.
Sourcepub fn with_test_context(self, test: TestContext) -> Self
pub fn with_test_context(self, test: TestContext) -> Self
Set the test context.
Sourcepub fn with_verbose(self, verbose: bool) -> Self
pub fn with_verbose(self, verbose: bool) -> Self
Set verbose mode.
Trait Implementations§
Source§impl Clone for PluginContext
impl Clone for PluginContext
Source§fn clone(&self) -> PluginContext
fn clone(&self) -> PluginContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PluginContext
impl RefUnwindSafe for PluginContext
impl Send for PluginContext
impl Sync for PluginContext
impl Unpin for PluginContext
impl UnsafeUnpin for PluginContext
impl UnwindSafe for PluginContext
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
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,
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