Trait PreCommit

Source
pub trait PreCommit: DeserializeOwned + Serialize {
    const PATH: &'static str;

    // Required method
    fn process(&mut self, install: bool);

    // Provided method
    fn main(install: bool) -> Result<()> { ... }
}

Required Associated Constants§

Source

const PATH: &'static str

Required Methods§

Source

fn process(&mut self, install: bool)

Provided Methods§

Source

fn main(install: bool) -> Result<()>

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.

Implementors§

Source§

impl PreCommit for PreCommitConfig

Source§

const PATH: &'static str = ".pre-commit-config.yaml"

Source§

impl PreCommit for PreCommitHooks

Source§

const PATH: &'static str = ".pre-commit-hooks.yaml"