[−][src]Struct nines::Rect
A rectangle. See also ValidRect. Generally not inclusive of the right/bottom edge.
Fields
left: V
right: V
top: V
bottom: V
Methods
impl<S: Scalar> Rect<S>
[src]
#[must_use]
pub fn xywh(x: S, y: S, w: S, h: S) -> Self
[src]
#[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: Scalar> From<Range<[S; 2]>> for Rect<S>
[src]
impl<S: Scalar> From<[Range<S>; 2]> for Rect<S>
[src]
impl<S: Scalar> From<Range<(S, S)>> for Rect<S>
[src]
impl<S: Scalar> From<(Range<S>, Range<S>)> for Rect<S>
[src]
impl<V: Clone + Debug> Clone for Rect<V>
[src]
impl<V: Copy + Debug> Copy for Rect<V>
[src]
impl<V: Default + Debug> Default for Rect<V>
[src]
impl<S: Scalar> PartialEq<Rect<S>> for ValidRect<S>
[src]
impl<S: Scalar> PartialEq<ValidRect<S>> for Rect<S>
[src]
fn eq(&self, other: &ValidRect<S>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<V: PartialEq + Debug> PartialEq<Rect<V>> for Rect<V>
[src]
impl<V: Debug> Debug for Rect<V>
[src]
impl<S: Scalar> TryFrom<Rect<S>> for ValidRect<S>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(value: Rect<S>) -> Result<Self, Error>
[src]
impl<'_, S: Scalar> TryFrom<&'_ Rect<S>> for ValidRect<S>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(value: &Rect<S>) -> Result<Self, Error>
[src]
impl<V: Debug> StructuralPartialEq for Rect<V>
[src]
Auto Trait Implementations
impl<V> Send for Rect<V> where
V: Send,
V: Send,
impl<V> Sync for Rect<V> where
V: Sync,
V: Sync,
impl<V> Unpin for Rect<V> where
V: Unpin,
V: Unpin,
impl<V> UnwindSafe for Rect<V> where
V: UnwindSafe,
V: UnwindSafe,
impl<V> RefUnwindSafe for Rect<V> where
V: RefUnwindSafe,
V: RefUnwindSafe,
Blanket Implementations
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 = !
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>,
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,