pub struct Context {
pub name: String,
pub nature: ContextNature,
pub package_directory: PathBuf,
pub workspace_root: Option<PathBuf>,
pub path_to_watch: Option<PathBuf>,
/* private fields */
}Expand description
information on the paths which are relevant for a mission
Fields§
§name: String§nature: ContextNature§package_directory: PathBufThe current package/project
workspace_root: Option<PathBuf>The root of the workspace, only defined when it makes sense and it’s different from the package directory.
Today it’s only obtained from cargo metadata but in the future it could be obtained from other kind of sources.
path_to_watch: Option<PathBuf>An optional path to watch, given at launch and overriding the settings of the Cargo.toml file, bacon.toml file, etc.
Implementations§
Source§impl Context
impl Context
pub fn new(args: &Args) -> Result<Self>
pub fn mission<'s>( &self, concrete_job_ref: ConcreteJobRef, leaf_job: &Job, settings: &'s Settings, ) -> Result<Mission<'s>>
pub fn workspace_cargo_path(&self) -> Option<PathBuf>
Sourcepub fn workspace_config_path(&self) -> Option<PathBuf>
pub fn workspace_config_path(&self) -> Option<PathBuf>
return the location of the workspace level bacon.toml file (if it’s different from the package level bacon.toml file)
pub fn workspace_dot_config_path(&self) -> Option<PathBuf>
pub fn package_cargo_path(&self) -> PathBuf
pub fn package_config_path(&self) -> PathBuf
pub fn package_dot_config_path(&self) -> PathBuf
pub fn unix_socket_path(&self) -> PathBuf
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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