Struct docx_rs::Pic

source ·
pub struct Pic {
Show 19 fields pub id: String, pub image: Vec<u8>, pub size: (u32, u32), pub position_type: DrawingPositionType, pub simple_pos: bool, pub simple_pos_x: i32, pub simple_pos_y: i32, pub layout_in_cell: bool, pub relative_height: u32, pub allow_overlap: bool, pub position_h: DrawingPosition, pub position_v: DrawingPosition, pub relative_from_h: RelativeFromHType, pub relative_from_v: RelativeFromVType, pub dist_t: i32, pub dist_b: i32, pub dist_l: i32, pub dist_r: i32, pub rot: u16,
}

Fields§

§id: String§image: Vec<u8>§size: (u32, u32)§position_type: DrawingPositionType§simple_pos: bool

Specifies that this object shall be positioned using the positioning information in the simplePos child element (§20.4.2.13). This positioning, when specified, positions the object on the page by placing its top left point at the x-y coordinates specified by that element.

§simple_pos_x: i32§simple_pos_y: i32§layout_in_cell: bool

Specifies how this DrawingML object behaves when its anchor is located in a table cell; and its specified position would cause it to intersect with a table cell displayed in the document. That behavior shall be as follows:

§relative_height: u32

Specifies the relative Z-ordering of all DrawingML objects in this document. Each floating DrawingML object shall have a Z-ordering value, which determines which object is displayed when any two objects intersect. Higher values shall indicate higher Z-order; lower values shall indicate lower Z-order.

§allow_overlap: bool§position_h: DrawingPosition§position_v: DrawingPosition§relative_from_h: RelativeFromHType§relative_from_v: RelativeFromVType§dist_t: i32

Specifies the minimum distance which shall be maintained between the top edge of this drawing object and any subsequent text within the document when this graphical object is displayed within the document’s contents., The distance shall be measured in EMUs (English Metric Units).,

§dist_b: i32§dist_l: i32§dist_r: i32§rot: u16

Implementations§

source§

impl Pic

source

pub fn new(buf: &[u8]) -> Pic

source

pub fn id(self, id: impl Into<String>) -> Pic

source

pub fn size(self, w_emu: u32, h_emu: u32) -> Pic

source

pub fn rotate(self, deg: u16) -> Pic

source

pub fn floating(self) -> Pic

source

pub fn overlapping(self) -> Pic

source

pub fn offset_x(self, x: i32) -> Pic

source

pub fn offset_y(self, y: i32) -> Pic

source

pub fn position_h(self, pos: DrawingPosition) -> Self

source

pub fn position_v(self, pos: DrawingPosition) -> Self

source

pub fn relative_from_h(self, t: RelativeFromHType) -> Self

source

pub fn relative_from_v(self, t: RelativeFromVType) -> Self

source

pub fn dist_t(self, v: i32) -> Self

source

pub fn dist_b(self, v: i32) -> Self

source

pub fn dist_l(self, v: i32) -> Self

source

pub fn dist_r(self, v: i32) -> Self

source

pub fn simple_pos(self, v: bool) -> Self

source

pub fn relative_height(self, v: u32) -> Self

Trait Implementations§

source§

impl Clone for Pic

source§

fn clone(&self) -> Pic

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Pic

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl ElementReader for Pic

source§

fn read<R: Read>( r: &mut EventReader<R>, _attrs: &[OwnedAttribute] ) -> Result<Self, ReaderError>

source§

impl PartialEq for Pic

source§

fn eq(&self, other: &Pic) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Pic

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for Pic

Auto Trait Implementations§

§

impl Freeze for Pic

§

impl RefUnwindSafe for Pic

§

impl Send for Pic

§

impl Sync for Pic

§

impl Unpin for Pic

§

impl UnwindSafe for Pic

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.