pub struct Dimensions {
pub width: Mm,
pub height: Mm,
pub margin_left: Mm,
pub margin_right: Mm,
pub margin_top: Mm,
pub margin_bottom: Mm,
}
Expand description
Stores the dimensions of the page
Fields§
§width: Mm
§height: Mm
§margin_left: Mm
§margin_right: Mm
§margin_top: Mm
§margin_bottom: Mm
Implementations§
Source§impl Dimensions
impl Dimensions
Sourcepub fn new_default_margins(width: Mm, height: Mm) -> Self
pub fn new_default_margins(width: Mm, height: Mm) -> Self
Initialises new Dimensions
with default margins, and given width
, and height
Sourcepub fn new(
width: Mm,
height: Mm,
margin_top: Mm,
margin_bottom: Mm,
margin_left: Mm,
margin_right: Mm,
) -> Self
pub fn new( width: Mm, height: Mm, margin_top: Mm, margin_bottom: Mm, margin_left: Mm, margin_right: Mm, ) -> Self
Initialises a new Dimensions
Sourcepub fn max_text_width(&self) -> Mm
pub fn max_text_width(&self) -> Mm
Computes the maximum text width (in millimetres)
Sourcepub fn max_text_height(&self) -> Mm
pub fn max_text_height(&self) -> Mm
Computes the maximum height that all the lines of text can be on a single page
Trait Implementations§
Source§impl Clone for Dimensions
impl Clone for Dimensions
Source§fn clone(&self) -> Dimensions
fn clone(&self) -> Dimensions
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Dimensions
impl Debug for Dimensions
Auto Trait Implementations§
impl Freeze for Dimensions
impl RefUnwindSafe for Dimensions
impl Send for Dimensions
impl Sync for Dimensions
impl Unpin for Dimensions
impl UnwindSafe for Dimensions
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<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