pub struct DocxImage {
pub image_path: String,
pub image_ext: String,
pub image_data: Vec<u8>,
pub relation_id: String,
pub width: u64,
pub height: u64,
}Fields§
§image_path: String§image_ext: String§image_data: Vec<u8>§relation_id: String§width: u64§height: u64Implementations§
Source§impl DocxImage
impl DocxImage
Sourcepub fn new_size(
image_path: &str,
width: u64,
height: u64,
) -> Result<Self, DocxError>
pub fn new_size( image_path: &str, width: u64, height: u64, ) -> Result<Self, DocxError>
设置图片大小
@param image_path 图片路径
@param width 图片宽度(emu)
@param height 图片高度 (emu)
Sourcepub fn new_image_data(
image_url: &str,
image_data: Vec<u8>,
image_ext: &str,
) -> Result<Self, DocxError>
pub fn new_image_data( image_url: &str, image_data: Vec<u8>, image_ext: &str, ) -> Result<Self, DocxError>
设置图片大小
@param image_url 图片路径
@param image_data 图片数据
Sourcepub fn new_image_data_size(
image_url: &str,
image_data: Vec<u8>,
image_ext: &str,
width: u64,
height: u64,
) -> Result<Self, DocxError>
pub fn new_image_data_size( image_url: &str, image_data: Vec<u8>, image_ext: &str, width: u64, height: u64, ) -> Result<Self, DocxError>
设置图片大小
@param image_url 图片路径
@param image_data 图片数据
@param image_ext 图片扩展名
@param width 图片宽度(emu)
@param height 图片高度(emu)
Sourcepub fn new_image_data_size_relation(
image_url: &str,
image_data: Vec<u8>,
image_ext: &str,
relation_id: &str,
width: u64,
height: u64,
) -> Self
pub fn new_image_data_size_relation( image_url: &str, image_data: Vec<u8>, image_ext: &str, relation_id: &str, width: u64, height: u64, ) -> Self
设置图片大小
@param image_url 图片路径
@param image_data 图片数据
@param image_ext 图片扩展名
@param relation_id 关联编号
@param width 图片宽度(emu)
@param height 图片高度(emu)
Sourcepub fn clone_image_reset_size(
docx_image: &DocxImage,
width: u64,
height: u64,
) -> Self
pub fn clone_image_reset_size( docx_image: &DocxImage, width: u64, height: u64, ) -> Self
克隆一个图片对象,并重新设置图片大小
@param docx_image 图片对象
@param width 图片宽度(emu)
@param height 图片高度(emu)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DocxImage
impl RefUnwindSafe for DocxImage
impl Send for DocxImage
impl Sync for DocxImage
impl Unpin for DocxImage
impl UnwindSafe for DocxImage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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