Struct euclid::SideOffsets2D [−][src]
#[repr(C)]pub struct SideOffsets2D<T, U> { pub top: T, pub right: T, pub bottom: T, pub left: T, // some fields omitted }
Expand description
A group of 2D side offsets, which correspond to top/right/bottom/left for borders, padding, and margins in CSS, optionally tagged with a unit.
Fields
top: T
right: T
bottom: T
left: T
Implementations
impl<T, U> SideOffsets2D<T, U>
[src]
impl<T, U> SideOffsets2D<T, U>
[src]pub const fn new(top: T, right: T, bottom: T, left: T) -> Self
[src]
pub const fn new(top: T, right: T, bottom: T, left: T) -> Self
[src]Constructor taking a scalar for each side.
Sides are specified in top-right-bottom-left order following CSS’s convention.
pub fn from_lengths(
top: Length<T, U>,
right: Length<T, U>,
bottom: Length<T, U>,
left: Length<T, U>
) -> Self
[src]
pub fn from_lengths(
top: Length<T, U>,
right: Length<T, U>,
bottom: Length<T, U>,
left: Length<T, U>
) -> Self
[src]Constructor taking a typed Length for each side.
Sides are specified in top-right-bottom-left order following CSS’s convention.
pub fn from_vectors_outer(min: Vector2D<T, U>, max: Vector2D<T, U>) -> Self where
T: Neg<Output = T>,
[src]
pub fn from_vectors_outer(min: Vector2D<T, U>, max: Vector2D<T, U>) -> Self where
T: Neg<Output = T>,
[src]Construct side offsets from min and a max vector offsets.
The outer rect of the resulting side offsets is equivalent to translating a rectangle’s upper-left corner with the min vector and translating the bottom-right corner with the max vector.
pub fn from_vectors_inner(min: Vector2D<T, U>, max: Vector2D<T, U>) -> Self where
T: Neg<Output = T>,
[src]
pub fn from_vectors_inner(min: Vector2D<T, U>, max: Vector2D<T, U>) -> Self where
T: Neg<Output = T>,
[src]Construct side offsets from min and a max vector offsets.
The inner rect of the resulting side offsets is equivalent to translating a rectangle’s upper-left corner with the min vector and translating the bottom-right corner with the max vector.
pub fn is_zero(&self) -> bool where
T: Zero + PartialEq,
[src]
pub fn is_zero(&self) -> bool where
T: Zero + PartialEq,
[src]Returns true
if all side offsets are zero.
pub fn new_all_same(all: T) -> Self where
T: Copy,
[src]
pub fn new_all_same(all: T) -> Self where
T: Copy,
[src]Constructor setting the same value to all sides, taking a scalar value directly.
pub fn from_length_all_same(all: Length<T, U>) -> Self where
T: Copy,
[src]
pub fn from_length_all_same(all: Length<T, U>) -> Self where
T: Copy,
[src]Constructor setting the same value to all sides, taking a typed Length.
pub fn horizontal(&self) -> T where
T: Copy + Add<T, Output = T>,
[src]
T: Copy + Add<T, Output = T>,
pub fn vertical(&self) -> T where
T: Copy + Add<T, Output = T>,
[src]
T: Copy + Add<T, Output = T>,
Trait Implementations
impl<T, U> Add<SideOffsets2D<T, U>> for SideOffsets2D<T, U> where
T: Add<T, Output = T>,
[src]
impl<T, U> Add<SideOffsets2D<T, U>> for SideOffsets2D<T, U> where
T: Add<T, Output = T>,
[src]impl<T: Clone, U> Clone for SideOffsets2D<T, U>
[src]
impl<T: Clone, U> Clone for SideOffsets2D<T, U>
[src]impl<T: Debug, U> Debug for SideOffsets2D<T, U>
[src]
impl<T: Debug, U> Debug for SideOffsets2D<T, U>
[src]impl<T: Default, U> Default for SideOffsets2D<T, U>
[src]
impl<T: Default, U> Default for SideOffsets2D<T, U>
[src]impl<T: Copy + Div, U> Div<T> for SideOffsets2D<T, U>
[src]
impl<T: Copy + Div, U> Div<T> for SideOffsets2D<T, U>
[src]impl<T: Copy + DivAssign, U> DivAssign<Scale<T, U, U>> for SideOffsets2D<T, U>
[src]
impl<T: Copy + DivAssign, U> DivAssign<Scale<T, U, U>> for SideOffsets2D<T, U>
[src]fn div_assign(&mut self, other: Scale<T, U, U>)
[src]
fn div_assign(&mut self, other: Scale<T, U, U>)
[src]Performs the /=
operation. Read more
impl<T: Copy + DivAssign, U> DivAssign<T> for SideOffsets2D<T, U>
[src]
impl<T: Copy + DivAssign, U> DivAssign<T> for SideOffsets2D<T, U>
[src]fn div_assign(&mut self, other: T)
[src]
fn div_assign(&mut self, other: T)
[src]Performs the /=
operation. Read more
impl<T, U> Hash for SideOffsets2D<T, U> where
T: Hash,
[src]
impl<T, U> Hash for SideOffsets2D<T, U> where
T: Hash,
[src]impl<T: Copy + Mul, U> Mul<T> for SideOffsets2D<T, U>
[src]
impl<T: Copy + Mul, U> Mul<T> for SideOffsets2D<T, U>
[src]impl<T: Copy + MulAssign, U> MulAssign<Scale<T, U, U>> for SideOffsets2D<T, U>
[src]
impl<T: Copy + MulAssign, U> MulAssign<Scale<T, U, U>> for SideOffsets2D<T, U>
[src]fn mul_assign(&mut self, other: Scale<T, U, U>)
[src]
fn mul_assign(&mut self, other: Scale<T, U, U>)
[src]Performs the *=
operation. Read more
impl<T: Copy + MulAssign, U> MulAssign<T> for SideOffsets2D<T, U>
[src]
impl<T: Copy + MulAssign, U> MulAssign<T> for SideOffsets2D<T, U>
[src]fn mul_assign(&mut self, other: T)
[src]
fn mul_assign(&mut self, other: T)
[src]Performs the *=
operation. Read more
impl<T, U> PartialEq<SideOffsets2D<T, U>> for SideOffsets2D<T, U> where
T: PartialEq,
[src]
impl<T, U> PartialEq<SideOffsets2D<T, U>> for SideOffsets2D<T, U> where
T: PartialEq,
[src]impl<T: Copy, U> Copy for SideOffsets2D<T, U>
[src]
impl<T, U> Eq for SideOffsets2D<T, U> where
T: Eq,
[src]
T: Eq,
Auto Trait Implementations
impl<T, U> RefUnwindSafe for SideOffsets2D<T, U> where
T: RefUnwindSafe,
U: RefUnwindSafe,
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for SideOffsets2D<T, U> where
T: Send,
U: Send,
T: Send,
U: Send,
impl<T, U> Sync for SideOffsets2D<T, U> where
T: Sync,
U: Sync,
T: Sync,
U: Sync,
impl<T, U> Unpin for SideOffsets2D<T, U> where
T: Unpin,
U: Unpin,
T: Unpin,
U: Unpin,
impl<T, U> UnwindSafe for SideOffsets2D<T, U> where
T: UnwindSafe,
U: UnwindSafe,
T: UnwindSafe,
U: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more