pub struct Config { /* private fields */ }Expand description
Main configuration structure.
Load configuration using Config::load, then access settings through
the provided methods.
§Example
use bob::Config;
use std::path::Path;
let config = Config::load(Some(Path::new("/data/bob/config.lua")), false)?;
println!("Building with {} threads", config.build_threads());Implementations§
Source§impl Config
impl Config
pub fn build_threads(&self) -> usize
pub fn scan_threads(&self) -> usize
pub fn strict_scan(&self) -> bool
pub fn script(&self, key: &str) -> Option<&PathBuf>
pub fn make(&self) -> &PathBuf
pub fn pkgpaths(&self) -> &Option<Vec<PkgPath>>
pub fn pkgsrc(&self) -> &PathBuf
pub fn sandboxes(&self) -> &Option<Sandboxes>
pub fn verbose(&self) -> bool
Sourcepub fn config_path(&self) -> Option<&Path>
pub fn config_path(&self) -> Option<&Path>
Return the path to the configuration file.
pub fn logdir(&self) -> &PathBuf
pub fn packages(&self) -> &PathBuf
pub fn pkgtools(&self) -> &PathBuf
pub fn prefix(&self) -> &PathBuf
pub fn report_dir(&self) -> Option<&PathBuf>
pub fn save_wrkdir_patterns(&self) -> &[String]
pub fn tar(&self) -> &PathBuf
pub fn build_user(&self) -> Option<&str>
pub fn bootstrap(&self) -> Option<&PathBuf>
Sourcepub fn get_pkg_env(
&self,
idx: &ResolvedIndex,
) -> Result<HashMap<String, String>, String>
pub fn get_pkg_env( &self, idx: &ResolvedIndex, ) -> Result<HashMap<String, String>, String>
Get environment variables for a package from the Lua env function/table.
Sourcepub fn script_env(&self) -> Vec<(String, String)>
pub fn script_env(&self) -> Vec<(String, String)>
Return environment variables for script execution.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl !RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl !UnwindSafe for Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more