pub struct DocxTemplate { /* private fields */ }Expand description
A DOCX package whose textual OOXML parts can be expanded from JSON data.
Implementations§
Source§impl DocxTemplate
impl DocxTemplate
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self>
pub fn open(path: impl AsRef<Path>) -> Result<Self>
Opens a DOCX template with the default untrusted-input ceilings.
Sourcepub fn open_with_limits(
path: impl AsRef<Path>,
limits: InputLimits,
) -> Result<Self>
pub fn open_with_limits( path: impl AsRef<Path>, limits: InputLimits, ) -> Result<Self>
Opens a DOCX template with explicit untrusted-input ceilings.
Sourcepub fn inspect(&self) -> TemplateInspection
pub fn inspect(&self) -> TemplateInspection
Inspects every supported textual part without modifying the template.
Sourcepub fn render_to_path(
&self,
data: &Value,
output: impl AsRef<Path>,
strict: bool,
) -> Result<TemplateRenderReport>
pub fn render_to_path( &self, data: &Value, output: impl AsRef<Path>, strict: bool, ) -> Result<TemplateRenderReport>
Renders JSON data into a new DOCX while preserving untouched package parts.
Missing values become empty strings with warnings by default. With
strict = true, they are errors and no output is written.
Trait Implementations§
Source§impl Clone for DocxTemplate
impl Clone for DocxTemplate
Source§fn clone(&self) -> DocxTemplate
fn clone(&self) -> DocxTemplate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DocxTemplate
impl RefUnwindSafe for DocxTemplate
impl Send for DocxTemplate
impl Sync for DocxTemplate
impl Unpin for DocxTemplate
impl UnsafeUnpin for DocxTemplate
impl UnwindSafe for DocxTemplate
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