[−][src]Struct nines::Dimensions
The dimensions of a nine-square layout. See also ValidDimensions.
left right ┌──→ +x
┊←──── outer ────→┊ │
┊ ┊ ↓
┊ ┊←─ inner ─→┊ ┊ + y
┊ ┊ ┊ ┊
┌──┬───────────┬──┐┈┈┈┈┈┈┈┈ top
│ │ │ │ ↑
├──┼───────────┼──┤┈┈┈┈ │
│ │ │ │ ↑ │
│ │ │ │ inner outer
│ │ │ │ ↓ │
├──┼───────────┼──┤┈┈┈┈ │
│ │ │ │ ↓
└──┴───────────┴──┘┈┈┈┈┈┈ bottom
Fields
outer: Rect<S>
inner: Rect<S>
Methods
impl<S: Scalar> Dimensions<S>
[src]
#[must_use]
pub fn validate(&self) -> Result<ValidDimensions<S>, Error>
[src]
Validate these dimensions are non-negative / non-NaN. This means:
outer.left ≤ inner.left ≤ inner.right ≤ outer.right
outer.top ≤ inner.top ≤ inner.bottom ≤ outer.bottom
Trait Implementations
impl<S: Clone + Scalar> Clone for Dimensions<S>
[src]
fn clone(&self) -> Dimensions<S>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<S: Copy + Scalar> Copy for Dimensions<S>
[src]
impl<S: Default + Scalar> Default for Dimensions<S>
[src]
fn default() -> Dimensions<S>
[src]
impl<S: Scalar> PartialEq<Dimensions<S>> for ValidDimensions<S>
[src]
fn eq(&self, other: &Dimensions<S>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<S: Scalar> PartialEq<ValidDimensions<S>> for Dimensions<S>
[src]
fn eq(&self, other: &ValidDimensions<S>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<S: PartialEq + Scalar> PartialEq<Dimensions<S>> for Dimensions<S>
[src]
fn eq(&self, other: &Dimensions<S>) -> bool
[src]
fn ne(&self, other: &Dimensions<S>) -> bool
[src]
impl<S: Debug + Scalar> Debug for Dimensions<S>
[src]
impl<S: Scalar> TryFrom<Dimensions<S>> for ValidDimensions<S>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(value: Dimensions<S>) -> Result<Self, Error>
[src]
impl<'_, S: Scalar> TryFrom<&'_ Dimensions<S>> for ValidDimensions<S>
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(value: &Dimensions<S>) -> Result<Self, Error>
[src]
impl<S: Scalar> StructuralPartialEq for Dimensions<S>
[src]
Auto Trait Implementations
impl<S> Send for Dimensions<S> where
S: Send,
S: Send,
impl<S> Sync for Dimensions<S> where
S: Sync,
S: Sync,
impl<S> Unpin for Dimensions<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for Dimensions<S> where
S: UnwindSafe,
S: UnwindSafe,
impl<S> RefUnwindSafe for Dimensions<S> where
S: RefUnwindSafe,
S: 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,