[−][src]Struct unsegen::widget::widget::Demand
A one dimensional description of spatial demand of a widget.
A Demand always has a minimum (although it may be zero) and may have a maximum. It is required that the minimum is smaller or equal to the maximum (if present).
Fields
min: PositiveAxisDiff<T>
max: Option<PositiveAxisDiff<T>>
Implementations
impl<T: AxisDimension + PartialOrd + Ord> Demand<T>
[src]
pub fn zero() -> Self
[src]
A minimum and maximum demand of exactly 0.
pub fn exact<I: Into<PositiveAxisDiff<T>> + Copy>(size: I) -> Self
[src]
A minimum and maximum demand of exactly the specified amount.
pub fn at_least<I: Into<PositiveAxisDiff<T>> + Copy>(size: I) -> Self
[src]
An specified minimum demand, but no defined maximum.
pub fn from_to<I: Into<PositiveAxisDiff<T>> + Copy>(min: I, max: I) -> Self
[src]
A specified range of acceptable values between minimum and maximum.
pub fn max(&self, other: Self) -> Self
[src]
Compute the composed maximum of two Demands. This is especially useful when building tables for example.
Examples:
use unsegen::widget::Demand; use unsegen::base::*; let d1 = Demand::<ColDimension>::exact(5); let d2 = Demand::<ColDimension>::at_least(0); assert_eq!(d1.max(d2), Demand::<ColDimension>::at_least(5));
pub fn max_assign(&mut self, other: Self)
[src]
Replace self with the maximum of self and other (see Demand::max
).
Trait Implementations
impl<T: AxisDimension> Add<Demand<T>> for Demand<T>
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self::Output
[src]
impl<T: AxisDimension> AddAssign<Demand<T>> for Demand<T>
[src]
fn add_assign(&mut self, rhs: Self)
[src]
impl<T: Clone + AxisDimension> Clone for Demand<T>
[src]
impl<T: Copy + AxisDimension> Copy for Demand<T>
[src]
impl<T: Debug + AxisDimension> Debug for Demand<T>
[src]
impl<T: Eq + AxisDimension> Eq for Demand<T>
[src]
impl<T: PartialEq + AxisDimension> PartialEq<Demand<T>> for Demand<T>
[src]
impl<T: PartialOrd + AxisDimension> PartialOrd<Demand<T>> for Demand<T>
[src]
fn partial_cmp(&self, other: &Demand<T>) -> Option<Ordering>
[src]
fn lt(&self, other: &Demand<T>) -> bool
[src]
fn le(&self, other: &Demand<T>) -> bool
[src]
fn gt(&self, other: &Demand<T>) -> bool
[src]
fn ge(&self, other: &Demand<T>) -> bool
[src]
impl<T: AxisDimension> StructuralEq for Demand<T>
[src]
impl<T: AxisDimension> StructuralPartialEq for Demand<T>
[src]
impl<'a, T: AxisDimension + PartialOrd + Ord> Sum<&'a Demand<T>> for Demand<T>
[src]
impl<T: AxisDimension + PartialOrd + Ord> Sum<Demand<T>> for Demand<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Demand<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Demand<T> where
T: Send,
T: Send,
impl<T> Sync for Demand<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Demand<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Demand<T> where
T: UnwindSafe,
T: UnwindSafe,
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>,