-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Partials are `Arc` so that - It doesn't matter if the partial is a reference to an existing one or created on the spot - Lifetime issues disappear instead of dealing with a `&'context Renderable` and `&mut 'context Context`.
- Loading branch information
Showing
3 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use std::fmt; | ||
use std::sync; | ||
|
||
use liquid_error::Result; | ||
|
||
use super::Renderable; | ||
|
||
/// Available partial-templates for including. | ||
pub trait PartialStore: fmt::Debug { | ||
/// Check if partial-template exists. | ||
fn contains(&self, name: &str) -> bool; | ||
|
||
/// Enumerate all partial-templates. | ||
fn names(&self) -> Vec<&str>; | ||
|
||
/// Access a partial-template. | ||
fn try_get(&self, name: &str) -> Option<sync::Arc<Renderable>>; | ||
|
||
/// Access a .partial-template | ||
fn get(&self, name: &str) -> Result<sync::Arc<Renderable>>; | ||
} |