pub struct DOCX {
pub content: HashMap<String, String>,
pub file_name: String,
pub placeholders: HashMap<String, Value>,
pub placeholders_blocks: HashMap<String, String>,
pub placeholder_images: HashMap<String, String>,
}Expand description
§DOCX struct
create template for docx file
file_name - docx file input name
content - content of word file
placeholder/placeholder_block/placeholder_images - saving your placeholders
Fields§
§content: HashMap<String, String>§file_name: String§placeholders: HashMap<String, Value>§placeholders_blocks: HashMap<String, String>§placeholder_images: HashMap<String, String>Implementations§
Source§impl DOCX
impl DOCX
Sourcepub fn add_placeholder<T>(&mut self, placeholder: &str, replaced_content: T)
pub fn add_placeholder<T>(&mut self, placeholder: &str, replaced_content: T)
Add placeholders to DOCX
placeholder - Placeholder
replaced_content - value for placeholder
Sourcepub fn add_placeholders_from_json(&mut self, placeholders_content: &str)
pub fn add_placeholders_from_json(&mut self, placeholders_content: &str)
Add placeholders from json
placeholders_content - json data
Sourcepub fn add_image_placeholder(&mut self, placeholder: &str, image: &str)
pub fn add_image_placeholder(&mut self, placeholder: &str, image: &str)
Add image placeholder
placeholder id of image in docx
image directory of image for replace
Sourcepub fn remove_image_placeholder(&mut self, placeholder: &str)
pub fn remove_image_placeholder(&mut self, placeholder: &str)
Remove image placeholder
placeholder - placeholder tag
Sourcepub fn init_placeholders(&mut self)
pub fn init_placeholders(&mut self)
Init placeholders
Auto Trait Implementations§
impl Freeze for DOCX
impl RefUnwindSafe for DOCX
impl Send for DOCX
impl Sync for DOCX
impl Unpin for DOCX
impl UnsafeUnpin for DOCX
impl UnwindSafe for DOCX
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