pub struct Output {
pub path: PathBuf,
}Expand description
Allows defining a cached file output and when it should be rebuilt.
Example usage:
use std::{fs, path::PathBuf};
let output_path = PathBuf::from("my/build/result.txt");
cicero_cache::Output::from(output_path.clone()).rebuild_on_change([
PathBuf::from("my/build/input.csv"),
], || {
if output_path.exists() {
fs::remove_file(&output_path)?;
}
fs::create_dir_all(output_path.parent().unwrap())?;
fs::File::create(output_path)?;
Ok(())
});Fields§
§path: PathBufImplementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Output
impl RefUnwindSafe for Output
impl Send for Output
impl Sync for Output
impl Unpin for Output
impl UnwindSafe for Output
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more