[]Struct gdnative::gdnative_common::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 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, U> TypedSideOffsets2D<T, U> where
    T: Copy

pub fn new(top: T, right: T, bottom: T, left: T) -> TypedSideOffsets2D<T, U>

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>
) -> TypedSideOffsets2D<T, U>

Constructor taking a typed Length for each side.

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

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

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

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

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

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

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

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

pub fn new_all_same(all: T) -> TypedSideOffsets2D<T, U>

Constructor setting the same value to all sides, taking a scalar value directly.

pub fn from_length_all_same(all: Length<T, U>) -> TypedSideOffsets2D<T, U>

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

pub fn horizontal(&self) -> T

pub fn vertical(&self) -> T

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

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

impl<T, U> TypedSideOffsets2D<T, U> where
    T: Zero + Copy

pub fn zero() -> TypedSideOffsets2D<T, U>

Constructor, setting all sides to zero.

Trait Implementations

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

#[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

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

type Output = TypedSideOffsets2D<T, U>

The resulting type after applying the + operator.

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

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

Performs copy-assignment from source. Read more

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

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

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

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

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> From for T
[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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