Struct Composer

Source
pub struct Composer {
    pub config_files: Vec<String>,
    pub workflows: RefCell<Vec<Workflow>>,
    pub custom_types: RefCell<HashMap<String, String>>,
}

Fields§

§config_files: Vec<String>§workflows: RefCell<Vec<Workflow>>§custom_types: RefCell<HashMap<String, String>>

Implementations§

Source§

impl Composer

Source

pub fn add_config(&mut self, config: &str)

Adds config file to the composer This method is called by the user

§Arguments
  • config - A string slice that holds the of the config file along with its name
§Example
use echo_library::Composer;
let mut composer = Composer::default();
composer.add_config("config/path/config_file_name_here");
Source

pub fn add_workflow( &self, name: String, version: String, tasks: HashMap<String, Task>, ) -> Result<(), Error>

Adds a new workflow to the composer. This method is invoked by the workflows function inside the starlark_module.

§Arguments
  • name - Name of the workflow to be added
  • version - Version of the workflow
  • tasks - HashMap of tasks associated with the workflow
  • custom_types - Optional vector of custom types names that are created within config for the workflow.
§Returns
  • Result<(), Error> - Result indicating success if the workflow is added successfully, or an error if the workflow name is empty or if there is a duplicate workflow name.
Source

pub fn build(verbose: bool, temp_dir: &Path) -> Result<(), Error>

Source§

impl Composer

Source

pub fn compile( &self, module: &str, files: &SourceFiles, loader: &mut HashMap<String, FrozenModule>, ) -> Result<FrozenModule, Error>

Source

pub fn build_directory( &self, build_path: &Path, out_path: &Path, quiet: bool, ) -> Result<(), Error>

Trait Implementations§

Source§

impl Debug for Composer

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Composer

Source§

fn default() -> Composer

Returns the “default value” for a type. Read more
Source§

impl<'pst> ProvidesStaticType<'pst> for Composer

Source§

type StaticType = Composer

Same type as Self but with lifetimes dropped to 'static. 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<'a, T> AnyLifetime<'a> for T
where T: ProvidesStaticType<'a> + 'a + ?Sized,

Source§

fn static_type_id() -> TypeId

Must return the TypeId of Self but where the lifetimes are changed to 'static. Must be consistent with static_type_of.
Source§

fn static_type_of(&self) -> TypeId

Must return the TypeId of Self but where the lifetimes are changed to 'static. Must be consistent with static_type_id. Must not consult the self parameter in any way.
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

Source§

fn ast(self, begin: usize, end: usize) -> Spanned<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,