Struct rckive_genpdf::elements::FramedElement
source · pub struct FramedElement<E: Element> { /* private fields */ }
Expand description
Adds a frame around the wrapped element.
Examples
Direct usage:
use rckive_genpdf::elements;
let p = elements::FramedElement::new(
elements::Paragraph::new("text"),
);
Using Element::framed
:
use rckive_genpdf::{elements, style, Element as _};
let p = elements::Paragraph::new("text").framed(style::LineStyle::new());
Implementations§
source§impl<E: Element> FramedElement<E>
impl<E: Element> FramedElement<E>
sourcepub fn new(element: E) -> FramedElement<E>
pub fn new(element: E) -> FramedElement<E>
Creates a new framed element that wraps the given element.
sourcepub fn with_line_style(
element: E,
line_style: impl Into<LineStyle>
) -> FramedElement<E>
pub fn with_line_style(
element: E,
line_style: impl Into<LineStyle>
) -> FramedElement<E>
Creates a new framed element that wraps the given element, and with the given line style.
Trait Implementations§
source§impl<E: Clone + Element> Clone for FramedElement<E>
impl<E: Clone + Element> Clone for FramedElement<E>
source§fn clone(&self) -> FramedElement<E>
fn clone(&self) -> FramedElement<E>
Returns a copy 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<E: Default + Element> Default for FramedElement<E>
impl<E: Default + Element> Default for FramedElement<E>
source§fn default() -> FramedElement<E>
fn default() -> FramedElement<E>
Returns the “default value” for a type. Read more
source§impl<E: Element> Element for FramedElement<E>
impl<E: Element> Element for FramedElement<E>
source§fn render(
&mut self,
context: &Context,
area: Area<'_>,
style: Style
) -> Result<RenderResult, Error>
fn render(
&mut self,
context: &Context,
area: Area<'_>,
style: Style
) -> Result<RenderResult, Error>
Renders this element to the given area using the given style and font cache. Read more
source§fn framed(self, line_style: impl Into<LineStyle>) -> FramedElement<Self>where
Self: Sized,
fn framed(self, line_style: impl Into<LineStyle>) -> FramedElement<Self>where
Self: Sized,
Draws a frame around this element using the given line style.