[−][src]Enum imgtiger::dimension::Dimension
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 CellsNpx
: N PixelsN%
: N Percentauto
: 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(&self) -> 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]
Auto Trait Implementations
impl Unpin for Dimension
impl Send for Dimension
impl Sync for Dimension
impl RefUnwindSafe for Dimension
impl UnwindSafe for Dimension
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,