pub struct DocxImage {
pub data: Vec<u8>,
pub width: u32,
pub height: u32,
pub content_type: String,
pub id: String,
}Expand description
An image to embed into the resulting DOCX document.
Produced when the layout pass identifies an image XObject on the page
that should be carried over to the Word document. The bytes are kept
verbatim; the DOCX writer wraps them in the appropriate w:drawing
element with the given dimensions.
Fields§
§data: Vec<u8>Raw image bytes in the format described by Self::content_type
(typically PNG or JPEG).
width: u32Image width in pixels. Used to compute the on-page rendered size.
height: u32Image height in pixels. Used to compute the on-page rendered size.
content_type: StringMIME type of Self::data — e.g. image/png, image/jpeg. Drives
the part name and Override content-type entry in the DOCX [Content_Types].xml.
id: StringStable identifier used to deduplicate images that appear on multiple pages and to wire up the relationship reference in the DOCX.
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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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