[][src]Struct polyhorn_ios::geometry::ByCorner

pub struct ByCorner<T> {
    pub all: LayoutAxisY<LayoutAxisX<T>>,
}

This is a wrapper that contains a value of the given type for each corner of a rectangle.

use polyhorn_ui::geometry::ByCorner;
use polyhorn_ui::layout::{LayoutAxisX, LayoutDirection};

let mut by_corner = ByCorner::<f32>::default();
by_corner.top = LayoutAxisX::dependent(10.0, 30.0);

assert_eq!(by_corner.top.left(LayoutDirection::LTR), &10.0);
assert_eq!(by_corner.top.left(LayoutDirection::RTL), &30.0);

Fields

all: LayoutAxisY<LayoutAxisX<T>>

This is a nested field that contains a potentially layout direction dependent horizontal axis in a layout direction independent vertical axis.

Implementations

impl<T> ByCorner<T>[src]

pub fn map<F, O>(self, op: F) -> ByCorner<O> where
    F: FnMut(T) -> O, 
[src]

Applies the given operation to every element of this structure and returns the result. The operation does not necessarily have to return a value of the same type.

Trait Implementations

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

impl Convert<PLYCornerRadii> for ByCorner<ByDirection<Dimension<f32>>>[src]

impl<T> Copy for ByCorner<T> where
    T: Copy
[src]

impl<T> Debug for ByCorner<T> where
    T: Debug
[src]

impl<T> Default for ByCorner<T> where
    T: Default
[src]

impl<T> Deref for ByCorner<T>[src]

type Target = LayoutAxisY<LayoutAxisX<T>>

The resulting type after dereferencing.

impl<T> DerefMut for ByCorner<T>[src]

impl<T> Eq for ByCorner<T> where
    T: Eq
[src]

impl<T> PartialEq<ByCorner<T>> for ByCorner<T> where
    T: PartialEq<T>, 
[src]

impl<T> StructuralEq for ByCorner<T>[src]

impl<T> StructuralPartialEq for ByCorner<T>[src]

impl<T> ToTokens for ByCorner<T> where
    T: ToTokens
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for ByCorner<T> where
    T: RefUnwindSafe

impl<T> Send for ByCorner<T> where
    T: Send

impl<T> Sync for ByCorner<T> where
    T: Sync

impl<T> Unpin for ByCorner<T> where
    T: Unpin

impl<T> UnwindSafe for ByCorner<T> where
    T: UnwindSafe

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

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

impl<T> AsAny for T where
    T: Any
[src]

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

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

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

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

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

impl<T> IsDefault for T where
    T: PartialEq<T> + Default + Copy
[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 = Infallible

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.