pub struct MasterPageElement {
pub id: String,
pub element_type: MasterElementType,
pub position: Position,
pub content: Option<String>,
pub style: Option<String>,
pub transform: Option<Transform>,
pub opacity: Option<f64>,
}Expand description
An element placed on a master page.
Fields§
§id: StringUnique identifier for this element.
element_type: MasterElementTypeElement type.
position: PositionPosition on the page.
content: Option<String>Element-specific content.
style: Option<String>Style name to apply.
transform: Option<Transform>2D transform.
opacity: Option<f64>Opacity (0.0 to 1.0).
Implementations§
Source§impl MasterPageElement
impl MasterPageElement
Sourcepub fn text(
id: impl Into<String>,
content: impl Into<String>,
position: Position,
) -> Self
pub fn text( id: impl Into<String>, content: impl Into<String>, position: Position, ) -> Self
Create a text element.
Sourcepub fn image(
id: impl Into<String>,
src: impl Into<String>,
position: Position,
) -> Self
pub fn image( id: impl Into<String>, src: impl Into<String>, position: Position, ) -> Self
Create an image element.
Sourcepub fn shape(
id: impl Into<String>,
shape_type: impl Into<String>,
position: Position,
) -> Self
pub fn shape( id: impl Into<String>, shape_type: impl Into<String>, position: Position, ) -> Self
Create a shape element.
Sourcepub fn with_style(self, style: impl Into<String>) -> Self
pub fn with_style(self, style: impl Into<String>) -> Self
Set the style.
Sourcepub fn with_opacity(self, opacity: f64) -> Self
pub fn with_opacity(self, opacity: f64) -> Self
Set the opacity.
Trait Implementations§
Source§impl Clone for MasterPageElement
impl Clone for MasterPageElement
Source§fn clone(&self) -> MasterPageElement
fn clone(&self) -> MasterPageElement
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MasterPageElement
impl Debug for MasterPageElement
Source§impl<'de> Deserialize<'de> for MasterPageElement
impl<'de> Deserialize<'de> for MasterPageElement
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MasterPageElement
impl PartialEq for MasterPageElement
Source§impl Serialize for MasterPageElement
impl Serialize for MasterPageElement
impl StructuralPartialEq for MasterPageElement
Auto Trait Implementations§
impl Freeze for MasterPageElement
impl RefUnwindSafe for MasterPageElement
impl Send for MasterPageElement
impl Sync for MasterPageElement
impl Unpin for MasterPageElement
impl UnsafeUnpin for MasterPageElement
impl UnwindSafe for MasterPageElement
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