Enum fpvsetup::MonitorDimensions[][src]

pub enum MonitorDimensions {
    WidthAndHeight {
        width: Length,
        height: Length,
    },
    DiagonalAndAspect {
        diagonal: Length,
        aspect: f64,
    },
}

The dimensions of a monitor.

Variants

WidthAndHeight

Dimensions expressed directly as the width and the height.

Fields of WidthAndHeight

width: Lengthheight: Length
DiagonalAndAspect

Dimensions expressed indirectly as the diagonal and the aspect ratio.

Fields of DiagonalAndAspect

diagonal: Length

The length of the (imaginary) line drawn between two opposite (top left and bottom right, for example) corners of the monitor.

aspect: f64

The aspect ratio, i.e. width / height.

Implementations

impl MonitorDimensions[src]

pub fn width_and_height(self) -> [Length; 2][src]

Returns the width and height of the monitor, calculating them indirectly if necessary.

pub fn aspect(self) -> f64[src]

Returns the aspect ratio of the monitor, calculating it if necessary.

pub fn diagonal(self) -> Length[src]

Returns the length of the diagonal of the monitor, calculating it if necessary.

pub fn as_width_and_height(self) -> Self[src]

Re-represents the dimensions as the WidthAndHeight variant.

pub fn as_diagonal_and_aspect(self) -> Self[src]

Re-represents the dimensions as the DiagonalAndAspect variant.

Trait Implementations

impl Clone for MonitorDimensions[src]

impl Copy for MonitorDimensions[src]

impl Debug for MonitorDimensions[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.