[−][src]Struct resvg::prelude::ScreenSize
A 2D screen size representation.
Width and height are guarantee to be > 0.
Methods
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 to_size(&self) -> Size
[src]
Converts the current ScreenSize
to Size
.
Trait Implementations
impl Clone for ScreenSize
[src]
fn clone(&self) -> ScreenSize
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for ScreenSize
[src]
impl Debug for ScreenSize
[src]
impl Display for ScreenSize
[src]
impl PartialEq<ScreenSize> for ScreenSize
[src]
fn eq(&self, other: &ScreenSize) -> bool
[src]
fn ne(&self, other: &ScreenSize) -> bool
[src]
impl StructuralPartialEq for ScreenSize
[src]
Auto Trait Implementations
impl RefUnwindSafe for ScreenSize
impl Send for ScreenSize
impl Sync for ScreenSize
impl Unpin for ScreenSize
impl UnwindSafe for ScreenSize
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,