aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Jacob Hoffman-Andrews <github@hoffman-andrews.com>2023-03-29 17:49:42 -0700
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2023-03-31 11:36:12 +0200
commit795554e84ad923ae249d22c6145b194678ff7d89 (patch)
tree75a691d3f9134cfd68d66e7340ccce2454f9d4f0
parent3b830b0fee51306f0100bb27292fd8dd09bf08f3 (diff)
downloadaskama-795554e84ad923ae249d22c6145b194678ff7d89.tar.gz
askama-795554e84ad923ae249d22c6145b194678ff7d89.tar.bz2
askama-795554e84ad923ae249d22c6145b194678ff7d89.zip
Template::SIZE_HINT: add documentation
Diffstat (limited to '')
-rw-r--r--askama/src/lib.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/askama/src/lib.rs b/askama/src/lib.rs
index 17085b5..906c79a 100644
--- a/askama/src/lib.rs
+++ b/askama/src/lib.rs
@@ -99,7 +99,15 @@ pub trait Template: fmt::Display {
/// The template's extension, if provided
const EXTENSION: Option<&'static str>;
- /// Provides a conservative estimate of the expanded length of the rendered template
+ /// Provides a rough estimate of the expanded length of the rendered template. Larger
+ /// values result in higher memory usage but fewer reallocations. Smaller values result in the
+ /// opposite. This value only affects [`render`]. It does not take effect when calling
+ /// [`render_into`], [`write_into`], the [`fmt::Display`] implementation, or the blanket
+ /// [`ToString::to_string`] implementation.
+ ///
+ /// [`render`]: Template::render
+ /// [`render_into`]: Template::render_into
+ /// [`write_into`]: Template::write_into
const SIZE_HINT: usize;
/// The MIME type (Content-Type) of the data that gets rendered by this Template