pub struct ColumnWidth { /* private fields */ }Expand description
A validated width range satisfying min <= ideal <= max.
Implementations§
Source§impl ColumnWidth
impl ColumnWidth
Sourcepub const fn new(
min: u16,
ideal: u16,
max: u16,
) -> Result<Self, ColumnWidthError>
pub const fn new( min: u16, ideal: u16, max: u16, ) -> Result<Self, ColumnWidthError>
Creates a width range after checking its invariants once.
§Errors
Returns ColumnWidthError unless min <= ideal <= max.
Sourcepub const fn flexible(min: u16, ideal: u16) -> Result<Self, ColumnWidthError>
pub const fn flexible(min: u16, ideal: u16) -> Result<Self, ColumnWidthError>
Creates a flexible column without an upper bound.
§Errors
Returns ColumnWidthError::MinExceedsIdeal when min > ideal.
pub const fn min(self) -> u16
pub const fn ideal(self) -> u16
pub const fn max(self) -> u16
Trait Implementations§
Source§impl Clone for ColumnWidth
impl Clone for ColumnWidth
Source§fn clone(&self) -> ColumnWidth
fn clone(&self) -> ColumnWidth
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 ColumnWidth
Source§impl Debug for ColumnWidth
impl Debug for ColumnWidth
impl Eq for ColumnWidth
Source§impl PartialEq for ColumnWidth
impl PartialEq for ColumnWidth
impl StructuralPartialEq for ColumnWidth
Auto Trait Implementations§
impl Freeze for ColumnWidth
impl RefUnwindSafe for ColumnWidth
impl Send for ColumnWidth
impl Sync for ColumnWidth
impl Unpin for ColumnWidth
impl UnsafeUnpin for ColumnWidth
impl UnwindSafe for ColumnWidth
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.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more