pub struct Margin {
pub left: f32,
pub right: f32,
pub top: f32,
pub bottom: f32,
}
Expand description
A value for all four sides of a rectangle, often used to express padding or spacing.
Can be added and subtracted to/from Rect
s.
Fields§
§left: f32
§right: f32
§top: f32
§bottom: f32
Implementations§
source§impl Margin
impl Margin
Trait Implementations§
source§impl AddAssign<Margin> for Rect
impl AddAssign<Margin> for Rect
Rect += Margin
source§fn add_assign(&mut self, margin: Margin)
fn add_assign(&mut self, margin: Margin)
Performs the
+=
operation. Read moresource§impl AddAssign<f32> for Margin
impl AddAssign<f32> for Margin
Margind += f32
source§fn add_assign(&mut self, v: f32)
fn add_assign(&mut self, v: f32)
Performs the
+=
operation. Read moresource§impl DivAssign<f32> for Margin
impl DivAssign<f32> for Margin
Margin /= f32
source§fn div_assign(&mut self, v: f32)
fn div_assign(&mut self, v: f32)
Performs the
/=
operation. Read moresource§impl MulAssign<f32> for Margin
impl MulAssign<f32> for Margin
Margin *= f32
source§fn mul_assign(&mut self, v: f32)
fn mul_assign(&mut self, v: f32)
Performs the
*=
operation. Read moresource§impl PartialEq for Margin
impl PartialEq for Margin
source§impl SubAssign<Margin> for Rect
impl SubAssign<Margin> for Rect
Rect -= Margin
source§fn sub_assign(&mut self, margin: Margin)
fn sub_assign(&mut self, margin: Margin)
Performs the
-=
operation. Read moresource§impl SubAssign<f32> for Margin
impl SubAssign<f32> for Margin
Margin -= f32
source§fn sub_assign(&mut self, v: f32)
fn sub_assign(&mut self, v: f32)
Performs the
-=
operation. Read moreimpl Copy for Margin
impl StructuralPartialEq for Margin
Auto Trait Implementations§
impl Freeze for Margin
impl RefUnwindSafe for Margin
impl Send for Margin
impl Sync for Margin
impl Unpin for Margin
impl UnwindSafe for Margin
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