pub struct Size { /* private fields */ }
Expand description
Implementations§
source§impl Size
impl Size
sourcepub fn from_wh(width: f32, height: f32) -> Option<Size>
pub fn from_wh(width: f32, height: f32) -> Option<Size>
Creates a new Size
from width and height.
sourcepub fn to_int_size(&self) -> IntSize
pub fn to_int_size(&self) -> IntSize
Converts into IntSize
.
sourcepub fn to_rect(&self, x: f32, y: f32) -> Option<Rect>
pub fn to_rect(&self, x: f32, y: f32) -> Option<Rect>
Converts the current size to Rect
at provided position.
sourcepub fn to_non_zero_rect(&self, x: f32, y: f32) -> NonZeroRect
pub fn to_non_zero_rect(&self, x: f32, y: f32) -> NonZeroRect
Converts the current size to NonZeroRect
at provided position.
Trait Implementations§
source§impl PartialEq for Size
impl PartialEq for Size
impl Copy for Size
impl StructuralPartialEq for Size
Auto Trait Implementations§
impl RefUnwindSafe for Size
impl Send for Size
impl Sync for Size
impl Unpin for Size
impl UnwindSafe for Size
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more