[][src]Struct sarchive::scheduler::slurm::SlurmJobEntry

pub struct SlurmJobEntry {
    pub path_: PathBuf,
    // some fields omitted
}

Representation of an entry in the Slurm job spool hash directories

Fields

path_: PathBuf

The full path to the job information directory

Methods

impl SlurmJobEntry[src]

pub fn new(path: &PathBuf, id: &str, cluster: &str) -> SlurmJobEntry[src]

Returns a new SlurmJobEntry with the given path to the job info and the given job ID

Arguments

  • path - A PathBuf pointing to the directory (usually .../job.)
  • id - A string slice representing the job ID

Examples


let p = PathBuf::from("/var/spool/slurm/hash.2/job.1234");
let id = "1234";
let cluster = "mycluster";

let job_entry = SlurmJobEntry::new(&p, &id, &cluster);

assert_eq!(job_entry.path_, p);

Trait Implementations

impl JobInfo for SlurmJobEntry[src]

fn jobid(&self) -> String[src]

Returns the job ID as a String

fn moment(&self) -> Instant[src]

Returns the time the jpb entry was created by SArchive

fn read_job_info(&mut self) -> Result<(), Error>[src]

Populates the job entry structure with the relevant information

For Slurm, this encompasses the job script and the job environment

fn files(&self) -> Vec<(String, Vec<u8>)>[src]

Returns a Vector with tuples containing the filename and the file contents for the script and environment files

fn script(&self) -> String[src]

Returns the job script as a String

fn extra_info(&self) -> Option<HashMap<String, String>>[src]

Returns the environment info (if any) as a HashMap, mapping env keys to values

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.