pub struct Rob {
pub cfg: Config,
/* private fields */
}
Expand description
The main Rob
structure.
Fields§
§cfg: Config
Implementations§
Source§impl Rob
impl Rob
pub const MAX_DIR_LVL: usize = 4usize
pub fn new() -> Rob
pub fn needs_rebuild_many(bin: &str, srcs: &Vec<String>) -> RobResult<bool>
Sourcepub fn go_rebuild_yourself(source_path: &str) -> IoResult<()>
pub fn go_rebuild_yourself(source_path: &str) -> IoResult<()>
Modified text from: https://github.com/tsoding/nobuild
Go Rebuild Urself™ Technology
How to use it:
fn main() {
go_rebuild_yourself!();
// actual work
}
After your added this macro every time you run ./rob
it will detect
that you modified its original source code and will try to rebuild itself
before doing any actual work. So you only need to bootstrap your build system
once.
The modification is detected by comparing the last modified times of the executable and its source code. The same way the make utility usually does it.
pub fn get_last_modification_time<P>(p: P) -> IoResult<SystemTime>
pub fn is_file<P>(p: P) -> bool
pub fn is_dir<P>(p: P) -> bool
pub fn path_exists<P>(p: P) -> bool
pub fn rename<P>(from: P, to: P) -> IoResult<()>
pub fn mkdir<P>(p: P) -> IoResult<()>
pub fn rm_if_exists<P>(p: P)
pub fn rm<P>(p: P) -> IoResult<()>
pub fn log(lvl: LogLevel, out: &str)
pub fn echo(&mut self, echo: bool) -> &mut Self
pub fn keepgoing(&mut self, keepgoing: bool) -> &mut Self
pub fn append<S>(&mut self, xs: &[S]) -> &mut Self
pub fn append_mv<S>(&mut self, xs: &[S]) -> &mut Self
pub fn execute_jobs_sync(&mut self) -> RobResult<Vec<Vec<Output>>>
pub fn execute_jobs_async(&mut self) -> RobResult<Vec<Vec<Output>>>
pub fn append_job_job(&mut self, job: Job) -> &mut Self
pub fn append_job<S>( &mut self, target: &str, deps: Vec<S>, cmd: RobCommand, ) -> &mut Self
pub fn execute(&mut self) -> IoResult<&mut Self>
pub fn execute_sync(&mut self) -> IoResult<Output>
pub fn execute_all_sync(&mut self) -> RobResult<Vec<Output>>
pub fn output(&mut self) -> Option<Output>
pub fn outputs_refs(&self) -> VecDeque<&Output>
pub fn outputs(self) -> VecDeque<Output>
Trait Implementations§
impl Eq for Rob
impl StructuralPartialEq for Rob
Auto Trait Implementations§
impl Freeze for Rob
impl RefUnwindSafe for Rob
impl Send for Rob
impl Sync for Rob
impl Unpin for Rob
impl UnwindSafe for Rob
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