[][src]Struct polyhorn_cli::template::SourceTree

pub struct SourceTree { /* fields omitted */ }

A source tree that is used to queue files that need to be generated.

Implementations

impl SourceTree[src]

pub fn new() -> SourceTree[src]

Creates a new empty source tree that can be written to disk.

pub fn copy(&mut self, name: &str, contents: &'static [u8])[src]

Queues a copy of the given contents to a file with the given name.

pub fn template(&mut self, name: &str, contents: &'static str)[src]

Queues an invocation of the given template that writes the result to a file with the given name.

pub fn len(&self) -> usize[src]

Returns the number of files that are queued for generation.

pub fn generate<'a>(
    &'a self,
    spec: &'a Spec,
    destination_path: &'a Path
) -> SourceTreeIter<'a>

Notable traits for SourceTreeIter<'a>

impl<'a> Iterator for SourceTreeIter<'a> type Item = Result<(), Error>;
[src]

Returns an iterator that generates the source files of this source tree and writes them to the given destination path one-by-one.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,