/// Read all available hook templates from the table's package directory into the table.
Read all available hook templates from the table's package directory into the table.
Read all available hook templates from the table ' s package directory into the table .
pub fn load<P, T>(package_name: &str, templates: T, hooks_path: P) -> Self
        where P: AsRef<Path>,
              T: AsRef<Path>
    {
        let mut table = HookTable::default();
        if let Ok(meta) = std::fs::metadata(templates.as_ref()) {
            if meta.is_dir() {
                table.file_updated = FileUpdatedHook::load(package_name, &hooks_path, &templates);
                table.health_check = HealthCheckHook::load(package_name, &hooks_path, &templates);
                table.suitability = SuitabilityHook::load(package_name, &hooks_path, &templates);
                table.init = InitHook::load(package_name, &hooks_path, &templates);
                table.reload = ReloadHook::load(package_name, &hooks_path, &templates);
                table.reconfigure = ReconfigureHook::load(package_name, &hooks_path, &templates);
                table.run = RunHook::load(package_name, &hooks_path, &templates);
                table.post_run = PostRunHook::load(package_name, &hooks_path, &templates);
                table.post_stop =
                    PostStopHook::load(package_name, &hooks_path, &templates).map(Arc::new);
            }
        }
        debug!("{}, Hooks loaded, destination={}, templates={}",
               package_name,
               hooks_path.as_ref().display(),
               templates.as_ref().display());
        table
    }
pub fn load < P , T > ( package_name : & str , templates : T , hooks_path : P ) -> Self where P : AsRef < Path > , T : AsRef < Path > { let mut table = HookTable :: default ( ) ; if let Ok ( meta ) = std :: fs :: metadata ( templates . as_ref ( ) ) { if meta . is_dir ( ) { table . file_updated = FileUpdatedHook :: load ( package_name , & hooks_path , & templates ) ; table . health_check = HealthCheckHook :: load ( package_name , & hooks_path , & templates ) ; table . suitability = SuitabilityHook :: load ( package_name , & hooks_path , & templates ) ; table . init = InitHook :: load ( package_name , & hooks_path , & templates ) ; table . reload = ReloadHook :: load ( package_name , & hooks_path , & templates ) ; table . reconfigure = ReconfigureHook :: load ( package_name , & hooks_path , & templates ) ; table . run = RunHook :: load ( package_name , & hooks_path , & templates ) ; table . post_run = PostRunHook :: load ( package_name , & hooks_path , & templates ) ; table . post_stop = PostStopHook :: load ( package_name , & hooks_path , & templates ) . map ( Arc :: new ) ; } } debug ! ( " " package_name hooks_path as_ref ( ) display ( ) templates as_ref ( ) display ( ) ) ; table }
Read all available hook templates from the table's package directory into the table.
Read all available hook templates from the table ' s package directory into the table .
package_name
&str
templates
T
hooks_path
P