[−][src]Struct euclid::TypedSideOffsets2D
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: T
right: T
bottom: T
left: 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]
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.
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]
T: Add<T, Output = T> + Copy,
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]
Trait Implementations
impl<T, U> PartialEq<TypedSideOffsets2D<T, U>> for TypedSideOffsets2D<T, U> where
T: PartialEq,
[src]
T: PartialEq,
fn eq(&self, other: &Self) -> bool
[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]
T: Eq,
impl<T, U> Hash for TypedSideOffsets2D<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,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: Debug, U> Debug for TypedSideOffsets2D<T, U>
[src]
impl<T, U> Add<TypedSideOffsets2D<T, U>> for TypedSideOffsets2D<T, U> where
T: Copy + Add<T, Output = T>,
[src]
T: Copy + Add<T, Output = T>,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self
[src]
impl<T, U> Copy for TypedSideOffsets2D<T, U> where
T: Copy,
[src]
T: Copy,
impl<T, U> Clone for TypedSideOffsets2D<T, U> where
T: Clone,
[src]
T: Clone,
fn clone(&self) -> Self
[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> Unpin for TypedSideOffsets2D<T, U> where
T: Unpin,
U: Unpin,
T: Unpin,
U: Unpin,
impl<T, U> Send for TypedSideOffsets2D<T, U> where
T: Send,
U: Send,
T: Send,
U: Send,
impl<T, U> Sync for TypedSideOffsets2D<T, U> where
T: Sync,
U: Sync,
T: Sync,
U: Sync,
impl<T, U> UnwindSafe for TypedSideOffsets2D<T, U> where
T: UnwindSafe,
U: UnwindSafe,
T: UnwindSafe,
U: UnwindSafe,
impl<T, U> RefUnwindSafe for TypedSideOffsets2D<T, U> where
T: RefUnwindSafe,
U: RefUnwindSafe,
T: RefUnwindSafe,
U: RefUnwindSafe,
Blanket Implementations
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,