Struct resvg::ScreenSize
source · [−]pub struct ScreenSize { /* private fields */ }
Expand description
A 2D screen size representation.
Width and height are guarantee to be > 0.
Implementations
sourceimpl ScreenSize
impl ScreenSize
sourcepub fn new(width: u32, height: u32) -> Option<ScreenSize>
pub fn new(width: u32, height: u32) -> Option<ScreenSize>
Creates a new ScreenSize
from values.
sourcepub fn scale_to(&self, to: ScreenSize) -> ScreenSize
pub fn scale_to(&self, to: ScreenSize) -> ScreenSize
Scales current size to specified size.
sourcepub fn expand_to(&self, to: ScreenSize) -> ScreenSize
pub fn expand_to(&self, to: ScreenSize) -> ScreenSize
Expands current size to specified size.
sourcepub fn fit_view_box(&self, vb: &ViewBox) -> ScreenSize
pub fn fit_view_box(&self, vb: &ViewBox) -> ScreenSize
Fits size into a viewbox.
Trait Implementations
sourceimpl Clone for ScreenSize
impl Clone for ScreenSize
sourcepub fn clone(&self) -> ScreenSize
pub fn clone(&self) -> ScreenSize
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ScreenSize
impl Debug for ScreenSize
sourceimpl Display for ScreenSize
impl Display for ScreenSize
sourceimpl PartialEq<ScreenSize> for ScreenSize
impl PartialEq<ScreenSize> for ScreenSize
sourcepub fn eq(&self, other: &ScreenSize) -> bool
pub fn eq(&self, other: &ScreenSize) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcepub fn ne(&self, other: &ScreenSize) -> bool
pub fn ne(&self, other: &ScreenSize) -> bool
This method tests for !=
.
impl Copy for ScreenSize
impl StructuralPartialEq for ScreenSize
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more