mdbook_journal/journal/topic/traits/entry_generation.rs
1use crate::prelude::*;
2
3// This is the interface a topic needs in order
4// to generate the required `Meta` for an `Entry`.
5//
6#[cfg_attr(test, automock)]
7pub trait EntryGenerationTrait {
8 fn created_at(&self) -> Result<UtcDateTime> {
9 Ok(Utc::now())
10 }
11
12 fn collect_value(&self, variable: &Variable) -> Result<Option<MetaValue>>;
13}