[−][src]Struct genpdf::elements::LinearLayout
Arranges a list of elements sequentually.
Currently, elements can only be arranged vertically.
Examples
With setters:
use genpdf::elements; let mut layout = elements::LinearLayout::vertical(); layout.push(elements::Paragraph::new("Test1")); layout.push(elements::Paragraph::new("Test2"));
Chained:
use genpdf::elements; let layout = elements::LinearLayout::vertical() .element(elements::Paragraph::new("Test1")) .element(elements::Paragraph::new("Test2"));
Implementations
impl LinearLayout
[src]
pub fn vertical() -> LinearLayout
[src]
Creates a new linear layout that arranges its elements vertically.
pub fn push<E: Element + 'static>(&mut self, element: E)
[src]
Adds the given element to this layout.
pub fn element<E: Element + 'static>(self, element: E) -> Self
[src]
Adds the given element to this layout and it returns the layout.
Trait Implementations
impl Element for LinearLayout
[src]
fn render(
&mut self,
font_cache: &FontCache,
area: Area<'_>,
style: Style
) -> Result<RenderResult, Error>
[src]
&mut self,
font_cache: &FontCache,
area: Area<'_>,
style: Style
) -> Result<RenderResult, Error>
fn framed(self) -> FramedElement<Self> where
Self: Sized,
[src]
Self: Sized,
fn padded(self, padding: impl Into<Margins>) -> PaddedElement<Self> where
Self: Sized,
[src]
Self: Sized,
fn styled(self, style: impl Into<Style>) -> StyledElement<Self> where
Self: Sized,
[src]
Self: Sized,
Auto Trait Implementations
impl !RefUnwindSafe for LinearLayout
impl !Send for LinearLayout
impl !Sync for LinearLayout
impl Unpin for LinearLayout
impl !UnwindSafe for LinearLayout
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,