[−][src]Struct unsegen::widget::widget::Demand2D
A two dimensional (rectangular) Demand (composed of Demand
s for columns and rows).
Fields
width: ColDemand
height: RowDemand
Implementations
impl Demand2D
[src]
pub fn add_vertical(self, other: Self) -> Self
[src]
Combine two Demand2D
s by accumulating the height and making the width accommodate both.
This is useful two compute the combined Demand2D
of two widgets arranged on top of each
other.
Examples:
use unsegen::base::*; use unsegen::widget::*; let d1 = Demand2D { width: ColDemand::exact(5), height: RowDemand::exact(5), }; let d2 = Demand2D { width: ColDemand::at_least(2), height: RowDemand::from_to(3, 5), }; assert_eq!( d1.add_vertical(d2), Demand2D { width: ColDemand::at_least(5), height: RowDemand::from_to(8, 10), } );
pub fn add_horizontal(self, other: Self) -> Self
[src]
Combine two Demand2D
s by accumulating the width and making the height accommodate both.
This is useful two compute the combined Demand2D
of two widgets arranged on top of each
other.
Examples:
use unsegen::base::*; use unsegen::widget::*; let d1 = Demand2D { width: ColDemand::exact(5), height: RowDemand::exact(5), }; let d2 = Demand2D { width: ColDemand::at_least(2), height: RowDemand::from_to(3, 5), }; assert_eq!( d1.add_horizontal(d2), Demand2D { width: ColDemand::at_least(7), height: RowDemand::exact(5), } );
Trait Implementations
impl Clone for Demand2D
[src]
impl Copy for Demand2D
[src]
impl Debug for Demand2D
[src]
impl Eq for Demand2D
[src]
impl PartialEq<Demand2D> for Demand2D
[src]
impl StructuralEq for Demand2D
[src]
impl StructuralPartialEq for Demand2D
[src]
Auto Trait Implementations
impl RefUnwindSafe for Demand2D
impl Send for Demand2D
impl Sync for Demand2D
impl Unpin for Demand2D
impl UnwindSafe for Demand2D
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
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.
pub fn to_owned(&self) -> T
[src]
pub 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 = Infallible
The type returned in the event of a conversion error.
pub 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>,