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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more