pub struct Thickness { /* private fields */ }
Implementations§
Source§impl Thickness
impl Thickness
pub const fn new(l: i32, t: i32, r: i32, b: i32) -> Self
Sourcepub const unsafe fn new_unchecked(l: i32, t: i32, r: i32, b: i32) -> Self
pub const unsafe fn new_unchecked(l: i32, t: i32, r: i32, b: i32) -> Self
§Safety
All passed parameters should be in the -(2¹⁶ - 1) ..= (2¹⁶ - 1)
range.
pub const fn all(a: i32) -> Thickness
pub fn l(self) -> i32
pub fn t(self) -> i32
pub fn r(self) -> i32
pub fn b(self) -> i32
pub fn align( inner: Vector, outer: Vector, h_align: HAlign, v_align: VAlign, ) -> Thickness
pub fn shrink_rect(self, rect: Rect) -> Rect
pub fn expand_rect(self, rect: Rect) -> Rect
pub fn shrink_optional_rect_size( self, rect_width: Option<i16>, rect_height: Option<i16>, ) -> (Option<i16>, Option<i16>)
pub fn expand_optional_rect_size( self, rect_width: Option<i16>, rect_height: Option<i16>, ) -> (Option<i16>, Option<i16>)
pub fn shrink_rect_size(self, rect_size: Vector) -> Vector
pub fn expand_rect_size(self, rect_size: Vector) -> Vector
pub fn shrink_band_h(self, band_h: i16) -> i16
pub fn expand_band_h(self, band_h: i16) -> i16
pub fn shrink_band_w(self, band_w: i16) -> i16
pub fn expand_band_w(self, band_w: i16) -> i16
Trait Implementations§
Source§impl AddAssign for Thickness
impl AddAssign for Thickness
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moreSource§impl SubAssign for Thickness
impl SubAssign for Thickness
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read moreimpl Copy for Thickness
impl Eq for Thickness
impl StructuralPartialEq for Thickness
Auto Trait Implementations§
impl Freeze for Thickness
impl RefUnwindSafe for Thickness
impl Send for Thickness
impl Sync for Thickness
impl Unpin for Thickness
impl UnwindSafe for Thickness
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§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