[][src]Struct ructe::Ructe

pub struct Ructe { /* fields omitted */ }

The main build-time interface of ructe.

Your build script should create an instance of Ructe and use it to compile templates and possibly get access to the static files handler.

When creating a Ructe it will create a file called templates.rs in your $OUT_DIR (which is normally created and specified by cargo). The methods will and content, and when the Ructe goes of of scope, the file will be completed.

Methods

impl Ructe[src]

pub fn from_env() -> Result<Ructe>[src]

Create a ructe instance from the OUT_DIR environment variable.

This should be correct when using ructe from a build script in your project.

pub fn new(out_dir: PathBuf) -> Result<Ructe>[src]

Create a ructe instance from the OUT_DIR environment variable.

This should be correct when using ructe from a build script in your project.

pub fn statics(&mut self) -> Result<StaticFiles>[src]

pub fn compile_templates<P>(&mut self, indir: P) -> Result<()> where
    P: AsRef<Path>, 
[src]

Create a templates module in outdir containing rust code for all templates found in indir.

Trait Implementations

impl Drop for Ructe[src]

Auto Trait Implementations

impl Send for Ructe

impl Sync for Ructe

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto 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<T> Any for T where
    T: 'static + ?Sized
[src]