1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
use std::fmt::{self, Write};
#[cfg(feature = "json")]
pub use yarte_helpers::helpers::{display_fn::DisplayFn, io_fmt::IoFmt};
pub use yarte_helpers::{helpers::Render, recompile, Error, Result};
pub trait TemplateTrait: fmt::Display {
fn call(&self) -> Result<String> {
let mut buf = String::with_capacity(Self::size_hint());
write!(buf, "{}", self).map(|_| buf)
}
fn size_hint() -> usize;
}
pub use yarte_derive::{Template, TemplateText};
pub use TemplateTrait as Template;
pub use TemplateTrait as TemplateText;
#[cfg(feature = "html-min")]
pub use yarte_derive::TemplateMin;
#[cfg(feature = "html-min")]
pub use TemplateTrait as TemplateMin;
#[cfg(feature = "wasm")]
pub use yarte_derive::TemplateWasmServer;
#[cfg(feature = "wasm")]
pub use TemplateTrait as TemplateWasmServer;
#[cfg(feature = "with-actix-web")]
pub mod aw {
pub use actix_web::{
error::ErrorInternalServerError, Error, HttpRequest, HttpResponse, Responder,
};
pub use futures::future::{err, ok, Ready};
}
#[cfg(feature = "wasm")]
pub mod serde_json {
pub use serde_json::to_string;
}
#[cfg(feature = "json")]
pub mod sd {
pub use serde_json::{to_writer, to_writer_pretty};
}