JobUnit

Trait JobUnit 

Source
pub trait JobUnit:
    Debug
    + Any
    + Sized
    + Copy
    + Hash
    + Eq
    + Send {
    // Required methods
    fn deps(&self) -> Vec<Self>;
    fn cmd(&self) -> Option<String>;
    fn out_file(&self) -> PathBuf;
    fn log_file(&self) -> Option<PathBuf>;
    fn name(&self) -> &'static str;

    // Provided method
    fn nice(&self) -> u16 { ... }
}
Expand description

A trait that must be implemented by struct representing job units.

A single struct is used to represent all the possible job units and their dependencies, so most of the checks are performed at run-time.

Required Methods§

Source

fn deps(&self) -> Vec<Self>

Generate a vector containing all dependencies of the self

Source

fn cmd(&self) -> Option<String>

Returns the command to run to generate the output file of the job

If no command is specified (ie. this function returns None), the output file must be present on disk.

Source

fn out_file(&self) -> PathBuf

Path of the output file

Source

fn log_file(&self) -> Option<PathBuf>

Path of the log file of the job, if any

Source

fn name(&self) -> &'static str

Name of the job

Provided Methods§

Source

fn nice(&self) -> u16

A nice-ness score akin to Unix niceness: the higher the highest priority.

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§