BuildLog

Struct BuildLog 

Source
pub struct BuildLog<'a> { /* private fields */ }
Expand description

Store a log of every command ran for every build. It has a few uses:

  1. (hashes of) command lines for existing output files, so we know when we need to rebuild due to the command changing
  2. timing information, perhaps for generating reports
  3. restat information

Implementations§

Source§

impl<'a> BuildLog<'a>

Source

pub fn new() -> Self

Source

pub fn open_for_write<User: BuildLogUser>( &self, path: &Path, user: &User, ) -> Result<(), String>

Source

pub fn record_command_without_timestamp( &self, state: &State, edge_idx: EdgeIndex, start_time: u64, end_time: u64, ) -> Result<(), ()>

Source

pub fn record_command( &self, state: &State, edge_idx: EdgeIndex, start_time: u64, end_time: u64, mtime: TimeStamp, ) -> Result<(), ()>

Source

pub fn close(&mut self)

Source

pub fn load(&mut self, path: &Path) -> Result<Option<String>, String>

Load the on-disk log.

Source

pub fn lookup_by_output(&self, path: &[u8]) -> Option<&BuildLogEntry>

Lookup a previously-run command by its output path.

Source

pub fn write_entry<W: Write>( &self, f: &W, entry: &BuildLogEntry, ) -> Result<(), ()>

Serialize an entry into a log file.

Source

pub fn recompact<User: BuildLogUser>( &self, path: &Path, user: &User, ) -> Result<(), String>

Rewrite the known log entries, throwing away old data.

Source

pub fn entries(&'a self) -> &'a HashMap<&'a str, &'a BuildLogEntry>

Auto Trait Implementations§

§

impl<'a> Freeze for BuildLog<'a>

§

impl<'a> RefUnwindSafe for BuildLog<'a>

§

impl<'a> Send for BuildLog<'a>

§

impl<'a> Sync for BuildLog<'a>

§

impl<'a> Unpin for BuildLog<'a>

§

impl<'a> UnwindSafe for BuildLog<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.