[][src]Struct euclid::TypedSideOffsets2D

#[repr(C)]
pub struct TypedSideOffsets2D<T, U> { pub top: T, pub right: T, pub bottom: T, pub left: T, // some fields omitted }

A group of 2D side offsets, which correspond to top/left/bottom/right for borders, padding, and margins in CSS, optionally tagged with a unit.

Fields

top: Tright: Tbottom: Tleft: T

Methods

impl<T: Copy, U> TypedSideOffsets2D<T, U>[src]

pub fn new(top: T, right: T, bottom: T, left: T) -> Self[src]

Constructor taking a scalar for each side.

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.

pub fn top_typed(&self) -> Length<T, U>[src]

Access self.top as a typed Length instead of a scalar value.

pub fn right_typed(&self) -> Length<T, U>[src]

Access self.right as a typed Length instead of a scalar value.

pub fn bottom_typed(&self) -> Length<T, U>[src]

Access self.bottom as a typed Length instead of a scalar value.

pub fn left_typed(&self) -> Length<T, U>[src]

Access self.left as a typed Length instead of a scalar value.

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> TypedSideOffsets2D<T, U> where
    T: Add<T, Output = T> + Copy
[src]

pub fn horizontal(&self) -> T[src]

pub fn vertical(&self) -> T[src]

pub fn horizontal_typed(&self) -> Length<T, U>[src]

pub fn vertical_typed(&self) -> Length<T, U>[src]

impl<T: Copy + Zero, U> TypedSideOffsets2D<T, U>[src]

pub fn zero() -> Self[src]

Constructor, setting all sides to zero.

Trait Implementations

impl<T, U> PartialEq<TypedSideOffsets2D<T, U>> for TypedSideOffsets2D<T, U> where
    T: PartialEq
[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<T, U> Eq for TypedSideOffsets2D<T, U> where
    T: Eq
[src]

impl<T, U> Hash for TypedSideOffsets2D<T, U> where
    T: Hash
[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T, U> Add<TypedSideOffsets2D<T, U>> for TypedSideOffsets2D<T, U> where
    T: Copy + Add<T, Output = T>, 
[src]

type Output = Self

The resulting type after applying the + operator.

impl<T: Debug, U> Debug for TypedSideOffsets2D<T, U>[src]

impl<T, U> Copy for TypedSideOffsets2D<T, U> where
    T: Copy
[src]

impl<T, U> Clone for TypedSideOffsets2D<T, U> where
    T: Clone
[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: Default, U> Default for TypedSideOffsets2D<T, U>[src]

Auto Trait Implementations

impl<T, U> Send for TypedSideOffsets2D<T, U> where
    T: Send,
    U: Send

impl<T, U> Sync for TypedSideOffsets2D<T, U> where
    T: Sync,
    U: Sync

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.