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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
use std::fmt::{self, Write};
#[cfg(all(feature = "bytes-buf", feature = "html-min"))]
pub use yarte_derive::ywrite_min;
pub use yarte_derive::{yformat, yformat_html};
#[cfg(feature = "bytes-buf")]
pub use yarte_derive::{ywrite, ywrite_html};
pub use yarte_helpers::at_helpers::*;
pub use yarte_helpers::{
helpers::{io_fmt::IoFmt, Aligned256, IntoCopyIterator, Render, RenderA},
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 TemplateBytesTrait as TemplateWasmServer;
#[cfg(feature = "fixed")]
pub trait TemplateFixedTrait {
unsafe fn call<'call>(
&self,
buf: &'call mut [std::mem::MaybeUninit<u8>],
) -> Option<&'call [u8]>;
unsafe fn ccall(self, buf: &mut [std::mem::MaybeUninit<u8>]) -> Option<&[u8]>;
}
#[cfg(feature = "fixed")]
pub use yarte_derive::{TemplateFixed, TemplateFixedText};
#[cfg(feature = "fixed")]
pub use yarte_helpers::helpers::{RenderFixed, RenderFixedA, RenderSafe, RenderSafeA};
#[cfg(feature = "fixed")]
pub use TemplateFixedTrait as TemplateFixed;
#[cfg(feature = "fixed")]
pub use TemplateFixedTrait as TemplateFixedText;
#[cfg(all(feature = "fixed", feature = "html-min"))]
pub use yarte_derive::TemplateFixedMin;
#[cfg(all(feature = "fixed", feature = "html-min"))]
pub use TemplateFixedTrait as TemplateFixedMin;
#[cfg(feature = "bytes-buf")]
pub trait TemplateBytesTrait {
fn call<B: Buffer>(&self, capacity: usize) -> B::Freeze;
fn ccall<B: Buffer>(self, capacity: usize) -> B::Freeze;
fn write_call<B: Buffer>(&self, buf: &mut B);
fn write_ccall<B: Buffer>(self, buf: &mut B);
}
#[cfg(all(feature = "bytes-buf", feature = "html-min"))]
pub use yarte_derive::TemplateBytesMin;
#[cfg(feature = "bytes-buf")]
pub use yarte_derive::{TemplateBytes, TemplateBytesText};
#[cfg(feature = "bytes-buf")]
pub use TemplateBytesTrait as TemplateBytes;
#[cfg(feature = "bytes-buf")]
pub use TemplateBytesTrait as TemplateBytesText;
#[cfg(all(feature = "bytes-buf", feature = "html-min"))]
pub use TemplateBytesTrait as TemplateBytesMin;
#[cfg(feature = "bytes-buf")]
pub use yarte_helpers::helpers::{RenderBytes, RenderBytesA, RenderBytesSafe, RenderBytesSafeA};
#[cfg(any(feature = "bytes-buf", feature = "json"))]
pub use buf_min::Buffer;
#[cfg(feature = "json")]
pub use yarte_derive::Serialize;
#[cfg(feature = "json")]
pub use yarte_helpers::helpers::json::{Serialize, *};