Mm

Struct Mm 

Source
pub struct Mm(pub(crate) f32);
Expand description

A length measured in millimeters.

genpdfi always uses millimeters as its length unit, except for the font size that is measured in points.

If you want to convert pixels or points into millimeters, you can use the printpdf::Pt and printpdf::Px types.

Tuple Fields§

§0: f32

Implementations§

Source§

impl Mm

Source

pub fn max(self, other: Mm) -> Mm

Returns the maximum of this value and the given value.

§Examples
use genpdfi_extended::Mm;
let a = Mm::from(10.0);
let b = Mm::from(20.0);
assert_eq!(a.max(b), b);
Source

pub fn as_f32(self) -> f32

Returns the internal value in mm as f32.

Trait Implementations§

Source§

impl Add for Mm

Source§

type Output = Mm

The resulting type after applying the + operator.
Source§

fn add(self, __rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl AddAssign for Mm

Source§

fn add_assign(&mut self, __rhs: Self)

Performs the += operation. Read more
Source§

impl Clone for Mm

Source§

fn clone(&self) -> Mm

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Mm

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Mm

Source§

fn default() -> Mm

Returns the “default value” for a type. Read more
Source§

impl<__derive_more_Rhs> Div<__derive_more_Rhs> for Mm
where f32: Div<__derive_more_Rhs, Output = f32>,

Source§

type Output = Mm

The resulting type after applying the / operator.
Source§

fn div(self, __rhs: __derive_more_Rhs) -> Self::Output

Performs the / operation. Read more
Source§

impl<__derive_more_Rhs> DivAssign<__derive_more_Rhs> for Mm
where f32: DivAssign<__derive_more_Rhs>,

Source§

fn div_assign(&mut self, __rhs: __derive_more_Rhs)

Performs the /= operation. Read more
Source§

impl From<Mm> for Mm

Source§

fn from(mm: Mm) -> Mm

Converts to this type from the input type.
Source§

impl From<Mm> for Mm

Source§

fn from(mm: Mm) -> Mm

Converts to this type from the input type.
Source§

impl From<Mm> for Pt

Source§

fn from(mm: Mm) -> Pt

Converts to this type from the input type.
Source§

impl From<Mm> for f32

Source§

fn from(value: Mm) -> Self

Converts to this type from the input type.
Source§

impl From<Pt> for Mm

Source§

fn from(pt: Pt) -> Mm

Converts to this type from the input type.
Source§

impl From<f32> for Mm

Source§

fn from(mm: f32) -> Mm

Converts to this type from the input type.
Source§

impl From<i16> for Mm

Source§

fn from(mm: i16) -> Mm

Converts to this type from the input type.
Source§

impl From<i32> for Mm

Source§

fn from(mm: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for Mm

Source§

fn from(mm: i8) -> Mm

Converts to this type from the input type.
Source§

impl From<u16> for Mm

Source§

fn from(mm: u16) -> Mm

Converts to this type from the input type.
Source§

impl From<u32> for Mm

Source§

fn from(mm: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Mm

Source§

fn from(mm: u8) -> Mm

Converts to this type from the input type.
Source§

impl<__derive_more_Rhs> Mul<__derive_more_Rhs> for Mm
where f32: Mul<__derive_more_Rhs, Output = f32>,

Source§

type Output = Mm

The resulting type after applying the * operator.
Source§

fn mul(self, __rhs: __derive_more_Rhs) -> Self::Output

Performs the * operation. Read more
Source§

impl<__derive_more_Rhs> MulAssign<__derive_more_Rhs> for Mm
where f32: MulAssign<__derive_more_Rhs>,

Source§

fn mul_assign(&mut self, __rhs: __derive_more_Rhs)

Performs the *= operation. Read more
Source§

impl PartialEq for Mm

Source§

fn eq(&self, other: &Mm) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Mm

Source§

fn partial_cmp(&self, other: &Mm) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Sub for Mm

Source§

type Output = Mm

The resulting type after applying the - operator.
Source§

fn sub(self, __rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl SubAssign for Mm

Source§

fn sub_assign(&mut self, __rhs: Self)

Performs the -= operation. Read more
Source§

impl Sum for Mm

Source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl Copy for Mm

Source§

impl StructuralPartialEq for Mm

Auto Trait Implementations§

§

impl Freeze for Mm

§

impl RefUnwindSafe for Mm

§

impl Send for Mm

§

impl Sync for Mm

§

impl Unpin for Mm

§

impl UnwindSafe for Mm

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Finish for T

§

fn finish(self)

Does nothing but move self, equivalent to drop.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

§

fn to_owned_table(&self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V