pub trait Hook<P: PhaseMarker>: Send + Sync {
type Output: Captured + 'static;
type Config: Serialize + for<'de> Deserialize<'de>;
const ID: &'static str;
// Required methods
fn from_config(config: &Value, project_root: &Path) -> CapsulaResult<Self>
where Self: Sized;
fn config(&self) -> &Self::Config;
fn run(
&self,
metadata: &PreparedRun,
params: &RuntimeParams<P>,
) -> CapsulaResult<Self::Output>;
}Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn from_config(config: &Value, project_root: &Path) -> CapsulaResult<Self>where
Self: Sized,
fn from_config(config: &Value, project_root: &Path) -> CapsulaResult<Self>where
Self: Sized,
Create a hook instance from JSON configuration
fn config(&self) -> &Self::Config
fn run( &self, metadata: &PreparedRun, params: &RuntimeParams<P>, ) -> CapsulaResult<Self::Output>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.