far_shared/lib.rs
1//! Code shared between the `far` and `far_macros` crates
2//!
3//! You should probably just be looking at the documentation for the `far` crate
4//! instead.
5
6#![warn(missing_docs)]
7#![warn(clippy::missing_docs_in_private_items)]
8
9use std::collections::HashMap;
10
11/// A type whose contents can be rendered into a template
12pub trait Render {
13 /// Perform the rendering
14 ///
15 /// The keys of the hashmap are the names of the placeholders in the
16 /// template, while the values are what will replace the former in the
17 /// rendered template.
18 fn render(&self) -> HashMap<&'static str, String>;
19
20 /// Get a list of the placeholder names
21 fn keys() -> Box<dyn Iterator<Item = &'static str>>;
22}