[−][src]Struct euclid::SideOffsets2D
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]
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]
top: Length<T, U>,
right: Length<T, U>,
bottom: Length<T, U>,
left: Length<T, U>
) -> Self
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]
T: Neg<Output = T>,
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]
T: Neg<Output = T>,
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.
impl<T: Copy, U> SideOffsets2D<T, U>
[src]
pub fn new_all_same(all: T) -> Self
[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
[src]
Constructor setting the same value to all sides, taking a typed Length.
impl<T, U> SideOffsets2D<T, U> where
T: Add<T, Output = T> + Copy,
[src]
T: Add<T, Output = T> + Copy,
pub fn horizontal(&self) -> T
[src]
pub fn vertical(&self) -> T
[src]
impl<T: Zero, U> SideOffsets2D<T, U>
[src]
Trait Implementations
impl<T, U> Add<SideOffsets2D<T, U>> for SideOffsets2D<T, U> where
T: Add<T, Output = T>,
[src]
T: Add<T, Output = T>,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self
[src]
impl<T: Clone, U> Clone for SideOffsets2D<T, U>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Copy, U> Copy 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: Clone + Div, U1, U2> Div<Scale<T, U1, U2>> for SideOffsets2D<T, U2>
[src]
type Output = SideOffsets2D<T::Output, U1>
The resulting type after applying the /
operator.
fn div(self, scale: Scale<T, U1, U2>) -> Self::Output
[src]
impl<T: Clone + Div, U> Div<T> for SideOffsets2D<T, U>
[src]
type Output = SideOffsets2D<T::Output, U>
The resulting type after applying the /
operator.
fn div(self, scale: T) -> Self::Output
[src]
impl<T: Clone + DivAssign, U> DivAssign<Scale<T, U, U>> for SideOffsets2D<T, U>
[src]
fn div_assign(&mut self, other: Scale<T, U, U>)
[src]
impl<T: Clone + DivAssign, U> DivAssign<T> for SideOffsets2D<T, U>
[src]
fn div_assign(&mut self, other: T)
[src]
impl<T, U> Eq for SideOffsets2D<T, U> where
T: Eq,
[src]
T: Eq,
impl<T, U> Hash for SideOffsets2D<T, U> where
T: Hash,
[src]
T: Hash,
fn hash<H: Hasher>(&self, h: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: Clone + Mul, U1, U2> Mul<Scale<T, U1, U2>> for SideOffsets2D<T, U1>
[src]
type Output = SideOffsets2D<T::Output, U2>
The resulting type after applying the *
operator.
fn mul(self, scale: Scale<T, U1, U2>) -> Self::Output
[src]
impl<T: Clone + Mul, U> Mul<T> for SideOffsets2D<T, U>
[src]
type Output = SideOffsets2D<T::Output, U>
The resulting type after applying the *
operator.
fn mul(self, scale: T) -> Self::Output
[src]
impl<T: Clone + MulAssign, U> MulAssign<Scale<T, U, U>> for SideOffsets2D<T, U>
[src]
fn mul_assign(&mut self, other: Scale<T, U, U>)
[src]
impl<T: Clone + MulAssign, U> MulAssign<T> for SideOffsets2D<T, U>
[src]
fn mul_assign(&mut self, other: T)
[src]
impl<T, U> PartialEq<SideOffsets2D<T, U>> for SideOffsets2D<T, U> where
T: PartialEq,
[src]
T: PartialEq,
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,