pub struct TemplateContext {
pub html: bool,
pub regions: Vec<(String, String)>,
pub pieces: Vec<PieceValue>,
pub metadata: Value,
pub config: Map<String, Value>,
pub artifacts: Vec<(String, String)>,
}Expand description
What a compose template reads: see the module documentation. The stage hands it to the template engine together with the compose template.
Fields§
§html: boolWhether the output is HTML. A template engine then escapes for HTML every value that the compose template writes, except a region and a piece’s text, which are already HTML.
regions: Vec<(String, String)>Every output region, by name, as text, in the backend’s order; on HTML, the content and each piece inside the element that carries its name.
pieces: Vec<PieceValue>The regions that are pieces, in the backend’s order.
metadata: ValueThe document’s metadata, as data.
config: Map<String, Value>The compose template’s own settings: its defaults, with the values of the render
option template_config written over them.
artifacts: Vec<(String, String)>The path of each file the compose template ships, as (name, path), in the order
in which its template engine gives them (TemplateEngine::artifacts; by default
the order of its description, Template::artifacts). A path is relative to the
folder where the program writes the output’s files, where the entry file lies
under a host’s usual naming of files. A template engine exposes them as the value
artifacts, a map from name to path.
Trait Implementations§
Source§impl Clone for TemplateContext
impl Clone for TemplateContext
Source§impl Debug for TemplateContext
impl Debug for TemplateContext
Source§impl PartialEq for TemplateContext
impl PartialEq for TemplateContext
impl StructuralPartialEq for TemplateContext
Auto Trait Implementations§
impl Forget for TemplateContext
impl Freeze for TemplateContext
impl Move for TemplateContext
impl RefUnwindSafe for TemplateContext
impl Send for TemplateContext
impl Sync for TemplateContext
impl Unpin for TemplateContext
impl UnsafeUnpin for TemplateContext
impl UnwindSafe for TemplateContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more