pub enum Constraint {
Min(u16),
Max(u16),
Length(u16),
Percentage(u16),
Ratio(u32, u32),
Fill(u16),
}Expand description
A size constraint for layout elements.
Variants§
Min(u16)
Minimum size in terminal columns or rows.
Max(u16)
Maximum size in terminal columns or rows.
Length(u16)
Exact size in terminal columns or rows.
Percentage(u16)
Percentage of the total available space.
Ratio(u32, u32)
Proportional fraction of the total space (numerator, denominator).
Fill(u16)
Grows to fill remaining space with the given priority.
Implementations§
Source§impl Constraint
impl Constraint
Sourcepub fn from_lengths<T>(lengths: T) -> Vec<Self>where
T: IntoIterator<Item = u16>,
pub fn from_lengths<T>(lengths: T) -> Vec<Self>where
T: IntoIterator<Item = u16>,
Create a vector of Constraint::Length values.
Sourcepub fn from_ratios<T>(ratios: T) -> Vec<Self>
pub fn from_ratios<T>(ratios: T) -> Vec<Self>
Create a vector of Constraint::Ratio values.
Sourcepub fn from_percentages<T>(percentages: T) -> Vec<Self>where
T: IntoIterator<Item = u16>,
pub fn from_percentages<T>(percentages: T) -> Vec<Self>where
T: IntoIterator<Item = u16>,
Create a vector of Constraint::Percentage values.
Sourcepub fn from_mins<T>(mins: T) -> Vec<Self>where
T: IntoIterator<Item = u16>,
pub fn from_mins<T>(mins: T) -> Vec<Self>where
T: IntoIterator<Item = u16>,
Create a vector of Constraint::Min values.
Sourcepub fn from_maxes<T>(maxes: T) -> Vec<Self>where
T: IntoIterator<Item = u16>,
pub fn from_maxes<T>(maxes: T) -> Vec<Self>where
T: IntoIterator<Item = u16>,
Create a vector of Constraint::Max values.
Sourcepub fn from_fills<T>(fills: T) -> Vec<Self>where
T: IntoIterator<Item = u16>,
pub fn from_fills<T>(fills: T) -> Vec<Self>where
T: IntoIterator<Item = u16>,
Create a vector of Constraint::Fill values.
Trait Implementations§
Source§impl AsRef<Constraint> for Constraint
impl AsRef<Constraint> for Constraint
Source§impl Clone for Constraint
impl Clone for Constraint
Source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Constraint
Source§impl Debug for Constraint
impl Debug for Constraint
Source§impl Default for Constraint
impl Default for Constraint
Source§impl Display for Constraint
impl Display for Constraint
impl Eq for Constraint
Source§impl From<&Constraint> for Constraint
impl From<&Constraint> for Constraint
Source§impl From<u16> for Constraint
impl From<u16> for Constraint
Source§impl Hash for Constraint
impl Hash for Constraint
Source§impl PartialEq for Constraint
impl PartialEq for Constraint
Source§fn eq(&self, other: &Constraint) -> bool
fn eq(&self, other: &Constraint) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Constraint
Auto Trait Implementations§
impl Freeze for Constraint
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnsafeUnpin for Constraint
impl UnwindSafe for Constraint
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.