pub struct FramedElement<E: Element> {
element: E,
is_first: bool,
line_style: LineStyle,
}Expand description
Adds a frame around the wrapped element.
§Examples
Direct usage:
use genpdfi_extended::elements;
let p = elements::FramedElement::new(
elements::Paragraph::new("text"),
);Using Element::framed:
use genpdfi_extended::{elements, style, Element as _};
let p = elements::Paragraph::new("text").framed(style::LineStyle::new());Fields§
§element: E§is_first: bool§line_style: LineStyleImplementations§
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 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<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.
Auto Trait Implementations§
impl<E> Freeze for FramedElement<E>where
E: Freeze,
impl<E> RefUnwindSafe for FramedElement<E>where
E: RefUnwindSafe,
impl<E> Send for FramedElement<E>where
E: Send,
impl<E> Sync for FramedElement<E>where
E: Sync,
impl<E> Unpin for FramedElement<E>where
E: Unpin,
impl<E> UnwindSafe for FramedElement<E>where
E: UnwindSafe,
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<E> IntoBoxedElement for Ewhere
E: Element + 'static,
impl<E> IntoBoxedElement for Ewhere
E: Element + 'static,
Source§fn into_boxed_element(self) -> Box<dyn Element>
fn into_boxed_element(self) -> Box<dyn Element>
Creates a boxed element from this element.
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.