[][src]Enum imgtiger::dimension::Dimension

pub enum Dimension {
    Cells(u32),
    Pixels(u32),
    Percent(u32),
    Auto,
}

A type to encode image dimensions

There are four variants of Dimension that describe each unit.

  • The Cells variant is used if you want an image to be 5 lines tall or 5 characters wide.
  • The Pixels variant is used to describe the image size in pixels.
  • The Percent variant uses the percent of the size of the viewport in that direction.
  • The Auto variant is used for automatic sizing. Auto uses the image's real size or tries to maintain the aspect ratio if the other dimension is already set.

A Dimension can be specified in a string as a number followed by a unit or with the keyword auto.

  • N: N Cells
  • Npx: N Pixels
  • N%: N Percent
  • auto: Auto

Variants

Cells(u32)Pixels(u32)Percent(u32)Auto

Trait Implementations

impl Into<String> for Dimension[src]

Convert a Dimension into a String

impl Clone for Dimension[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<Dimension> for Dimension[src]

impl Copy for Dimension[src]

impl Debug for Dimension[src]

impl FromStr for Dimension[src]

type Err = DimensionParseError

The associated error which can be returned from parsing.

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]