Skip to main content

Registry

Struct Registry 

Source
pub struct Registry { /* private fields */ }
Expand description

Task registry with deterministic listing and collision errors.

Implementations§

Source§

impl Registry

Source

pub fn new() -> Self

Source

pub fn discover() -> Result<Self>

Discover task functions registered by #[bake::task] in this executable and its linked dependencies. Nested Rust modules become task namespaces.

A dependency that contributes tasks must be referenced by the executable (for example, use bake_releases as _;) so the linker includes it.

Source

pub fn register(&mut self, task: Task) -> Result<&mut Self>

Source

pub fn replace(&mut self, name: &str, task: Task) -> Result<&mut Self>

Replace an existing task explicitly, most often the default output task.

Source

pub fn include(&mut self, namespace: &str, other: Registry) -> Result<&mut Self>

Source

pub fn tasks(&self) -> impl Iterator<Item = &Task>

Source

pub fn context(self, root: impl Into<PathBuf>) -> Context

Create an isolated execution context with this registry and a project root.

Source

pub fn help(&self, name: Option<&str>) -> Result<String>

Source

pub fn run(self) -> Result<()>

Run the process command line and print its final result through output.

Source

pub fn run_arguments( self, root: impl Into<PathBuf>, tokens: &[String], ) -> Result<String>

Execute a command line without writing directly to stdout. Parsing and type validation finish before any task starts. Tasks may write an output file or return captured output.

Trait Implementations§

Source§

impl Default for Registry

Source§

fn default() -> Self

Returns the “default value” for a type. 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.