Context

Struct Context 

Source
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: PathBuf

The 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

Source

pub fn new(args: &Args) -> Result<Self>

Source

pub fn mission<'s>( &self, concrete_job_ref: ConcreteJobRef, leaf_job: &Job, settings: &'s Settings, ) -> Result<Mission<'s>>

Source

pub fn workspace_cargo_path(&self) -> Option<PathBuf>

Source

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)

Source

pub fn workspace_dot_config_path(&self) -> Option<PathBuf>

Source

pub fn package_cargo_path(&self) -> PathBuf

Source

pub fn package_config_path(&self) -> PathBuf

Source

pub fn package_dot_config_path(&self) -> PathBuf

Source

pub fn unix_socket_path(&self) -> PathBuf

Trait Implementations§

Source§

impl Debug for Context

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T