Struct Stuart

Source
pub struct Stuart {
    pub dir: PathBuf,
    pub input: Option<Node>,
    pub output: Option<Node>,
    pub config: Config,
    pub base: Option<StackFrame>,
    pub plugins: Option<Box<dyn Manager>>,
}
Expand description

The project builder.

Fields§

§dir: PathBuf

The input directory.

§input: Option<Node>

The input virtual filesystem tree.

§output: Option<Node>

The output virtual filesystem tree.

§config: Config

The configuration of the project.

§base: Option<StackFrame>

The base stack frame for each node.

§plugins: Option<Box<dyn Manager>>

The plugins to be used by Stuart.

Implementations§

Source§

impl Stuart

Source

pub fn new(dir: impl AsRef<Path>) -> Self

Creates a new builder from an input directory.

Source

pub fn new_from_node(node: Node) -> Self

Creates a new builder from a virtual filesystem tree. (for tests)

Source

pub fn with_config(self, config: Config) -> Self

Sets the configuration to use.

Source

pub fn with_plugins<T>(self, plugins: T) -> Self
where T: Manager + 'static,

Sets the plugin manager to use.

Source

pub fn build(&mut self, stuart_env: String) -> Result<(), Error>

Attempts to build the project.

Source

pub fn merge_output(&mut self, node: Node) -> Result<(), Error>

Merges an output node with the built result.

This is used for merging static content with the build output.

Source

pub fn save(&self, path: impl AsRef<Path>) -> Result<(), Error>

Saves the build output to a directory.

Source

pub fn save_metadata(&self, path: impl AsRef<Path>) -> Result<(), Error>

Saves the build metadata to a file.

Auto Trait Implementations§

§

impl Freeze for Stuart

§

impl !RefUnwindSafe for Stuart

§

impl !Send for Stuart

§

impl !Sync for Stuart

§

impl Unpin for Stuart

§

impl !UnwindSafe for Stuart

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 = 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.