mod debug;
mod null;
mod prelude {
pub use crate::data::PageRef;
pub use crate::includes::{FetchedPage, IncludeRef, Includer};
pub use std::borrow::Cow;
}
use crate::includes::{IncludeRef, PageRef};
use std::borrow::Cow;
pub use self::debug::DebugIncluder;
pub use self::null::NullIncluder;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
pub struct FetchedPage<'t> {
pub page_ref: PageRef,
pub content: Option<Cow<'t, str>>,
}
pub trait Includer<'t> {
type Error;
fn include_pages(
&mut self,
includes: &[IncludeRef<'t>],
) -> Result<Vec<FetchedPage<'t>>, Self::Error>;
fn no_such_include(
&mut self,
page_ref: &PageRef,
) -> Result<Cow<'t, str>, Self::Error>;
}