[][src]Struct nines::ValidRect

pub struct ValidRect<S: Scalar>(_);

A rectangle with non-negative & non-NAN dimensions.

Do not base soundness assumptions on this definition of validity - debug_assert_valid can bypass checks.

Methods

impl<S: Scalar> ValidRect<S>[src]

#[must_use] pub fn width(&self) -> S[src]

#[must_use] pub fn height(&self) -> S[src]

#[must_use] pub fn size(&self) -> [S; 2][src]

Methods from Deref<Target = Rect<S>>

#[must_use] pub fn grow(&self, borders: &Self) -> Self[src]

#[must_use] pub fn shrink(&self, borders: &Self) -> Self[src]

#[must_use] pub fn validate(&self) -> Result<ValidRect<S>, Error>[src]

Validate this rectangle has non-negative / non-NaN dimensions. This means:

left ≤ right
top ≤ bottom

Trait Implementations

impl<S: Clone + Scalar> Clone for ValidRect<S>[src]

impl<S: Copy + Scalar> Copy for ValidRect<S>[src]

impl<S: Default + Scalar> Default for ValidRect<S>[src]

impl<S: Scalar> PartialEq<ValidRect<S>> for ValidRect<S>[src]

impl<S: Scalar> PartialEq<Rect<S>> for ValidRect<S>[src]

impl<S: Scalar> PartialEq<ValidRect<S>> for Rect<S>[src]

impl<S: Scalar> Deref for ValidRect<S>[src]

type Target = Rect<S>

The resulting type after dereferencing.

impl<S: Debug + Scalar> Debug for ValidRect<S>[src]

impl<S: Scalar> TryFrom<Rect<S>> for ValidRect<S>[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'_, S: Scalar> TryFrom<&'_ Rect<S>> for ValidRect<S>[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<S> Send for ValidRect<S> where
    S: Send

impl<S> Sync for ValidRect<S> where
    S: Sync

impl<S> Unpin for ValidRect<S> where
    S: Unpin

impl<S> UnwindSafe for ValidRect<S> where
    S: UnwindSafe

impl<S> RefUnwindSafe for ValidRect<S> where
    S: RefUnwindSafe

Blanket Implementations

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = !

The type returned in the event of a conversion error.

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]