Struct usvg::ScreenSize[][src]

pub struct ScreenSize { /* fields omitted */ }

A 2D screen size representation.

Width and height are guarantee to be > 0.

Implementations

impl ScreenSize[src]

pub fn new(width: u32, height: u32) -> Option<Self>[src]

Creates a new ScreenSize from values.

pub fn width(&self) -> u32[src]

Returns width.

pub fn height(&self) -> u32[src]

Returns height.

pub fn dimensions(&self) -> (u32, u32)[src]

Returns width and height as a tuple.

pub fn scale_to(&self, to: Self) -> Self[src]

Scales current size to specified size.

pub fn expand_to(&self, to: Self) -> Self[src]

Expands current size to specified size.

pub fn fit_view_box(&self, vb: &ViewBox) -> Self[src]

Fits size into a viewbox.

pub fn to_size(&self) -> Size[src]

Converts the current ScreenSize to Size.

Trait Implementations

impl Clone for ScreenSize[src]

impl Copy for ScreenSize[src]

impl Debug for ScreenSize[src]

impl Display for ScreenSize[src]

impl PartialEq<ScreenSize> for ScreenSize[src]

impl StructuralPartialEq for ScreenSize[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.