pub struct Constraint {
pub min: Size,
pub max: Size,
}
Expand description
Rendering constraint.
Fields§
§min: Size
Minimum space the element can take.
max: Size
Maximum space the element can take.
Implementations§
Source§impl Constraint
impl Constraint
Sourcepub const UNBOUNDED: Constraint
pub const UNBOUNDED: Constraint
Can satisfy any size of object.
Sourcepub fn new(min: Size, max: Size) -> Constraint
pub fn new(min: Size, max: Size) -> Constraint
Create a new constraint.
Sourcepub fn max(max: Size) -> Constraint
pub fn max(max: Size) -> Constraint
A constraint with only a maximum size.
Sourcepub fn tight(cols: usize) -> Constraint
pub fn tight(cols: usize) -> Constraint
A constraint that can only be satisfied by a single column size. The rows are unconstrained.
Sourcepub fn from_env() -> Option<Constraint>
pub fn from_env() -> Option<Constraint>
Create a constraint from the terminal environment.
Returns None
if the output device is not a terminal.
Trait Implementations§
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Constraint
impl Debug for Constraint
Source§impl Default for Constraint
impl Default for Constraint
Source§fn default() -> Constraint
fn default() -> Constraint
Returns the “default value” for a type. Read more
Source§impl PartialEq for Constraint
impl PartialEq for Constraint
impl Copy for Constraint
impl Eq for Constraint
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 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§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.