[−][src]Struct ructe::Ructe
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]
P: AsRef<Path>,
Create a templates
module in outdir
containing rust code for
all templates found in indir
.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,