pub struct DocxTemplate { /* private fields */ }Implementations§
Source§impl DocxTemplate
impl DocxTemplate
pub fn new() -> Self
Sourcepub fn add_text_replacement(&mut self, placeholder: &str, value: &str)
pub fn add_text_replacement(&mut self, placeholder: &str, value: &str)
添加待替换的字符以及对应的值 @param placeholder 替换的字符串 @param value 替换的值
Sourcepub fn add_image_replacement(
&mut self,
placeholder: &str,
image_path: Option<&str>,
) -> Result<(), DocxError>
pub fn add_image_replacement( &mut self, placeholder: &str, image_path: Option<&str>, ) -> Result<(), DocxError>
添加要替换的图片 @param placeholder 替换的字符串 @param image_path 图片路径
Sourcepub fn add_image_size_replacement(
&mut self,
placeholder: &str,
image_path: Option<&str>,
width: f32,
height: f32,
) -> Result<(), DocxError>
pub fn add_image_size_replacement( &mut self, placeholder: &str, image_path: Option<&str>, width: f32, height: f32, ) -> Result<(), DocxError>
添加要替换的图片 @param placeholder 替换的字符串 @param image_path 图片路径 @param width 图片的宽度(厘米) @param height 图片的高度(厘米)
Sourcepub async fn add_image_url_replacement(
&mut self,
placeholder: &str,
image_url: Option<&str>,
) -> Result<(), DocxError>
pub async fn add_image_url_replacement( &mut self, placeholder: &str, image_url: Option<&str>, ) -> Result<(), DocxError>
添加要替换的图片 @param placeholder 替换的字符串 @param image_path 图片路径
Auto Trait Implementations§
impl Freeze for DocxTemplate
impl !RefUnwindSafe for DocxTemplate
impl Send for DocxTemplate
impl Sync for DocxTemplate
impl Unpin 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