pub struct Body(/* private fields */);Expand description
The content a create writes: text given as it is, or a template’s rendering.
Built only by Body::plain, Body::rendered and Body::rendered_as, so a rendered
body always carries the TemplateProvenance its rendering proves — a rendering whose
digest is not one is refused where the body is built, never later where it is written.
Implementations§
Source§impl Body
impl Body
Sourcepub fn rendered(
template: &TemplateInput,
rendered: RenderedTemplate,
) -> Result<Self, TemplateError>
pub fn rendered( template: &TemplateInput, rendered: RenderedTemplate, ) -> Result<Self, TemplateError>
Sourcepub fn rendered_as(
template: impl Into<String>,
rendered: RenderedTemplate,
) -> Result<Self, TemplateError>
pub fn rendered_as( template: impl Into<String>, rendered: RenderedTemplate, ) -> Result<Self, TemplateError>
A template’s rendering, recorded by template — a string of a library caller’s own.
§Errors
TemplateError::Malformed when the rendering’s digest is not one: a
RenderedTemplate assembled by hand rather than answered by a render.
Trait Implementations§
impl StructuralPartialEq for Body
Auto Trait Implementations§
impl Freeze for Body
impl RefUnwindSafe for Body
impl Send for Body
impl Sync for Body
impl Unpin for Body
impl UnsafeUnpin for Body
impl UnwindSafe for Body
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
Mutably borrows from an owned value. Read more