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<'de> Deserialize<'de> for Margin
impl<'de> Deserialize<'de> for Margin
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§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 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