Struct unsegen::widget::widget::Demand2D [−][src]
Expand description
A two dimensional (rectangular) Demand (composed of Demand
s for columns and rows).
Fields
width: ColDemand
height: RowDemand
Implementations
impl Demand2D
[src]
impl Demand2D
[src]pub fn add_vertical(self, other: Self) -> Self
[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]
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 Copy for Demand2D
[src]
impl Eq 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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more