Struct tui::widgets::Borders [−]
pub struct Borders { /* fields omitted */ }
Methods
impl Borders
impl Borders
pub const NONE: Borders
NONE: Borders = Borders{bits: 1,}
Show no border (default)
pub const TOP: Borders
TOP: Borders = Borders{bits: 2,}
Show the top border
pub const RIGHT: Borders
RIGHT: Borders = Borders{bits: 4,}
Show the right border
pub const BOTTOM: Borders
BOTTOM: Borders = Borders{bits: 8,}
Show the bottom border
pub const LEFT: Borders
LEFT: Borders = Borders{bits: 16,}
Show the left border
pub const ALL: Borders
ALL: Borders = Borders{bits: <Self>::TOP.bits | <Self>::RIGHT.bits | <Self>::BOTTOM.bits | <Self>::LEFT.bits,}
Show all borders
pub fn empty() -> Borders
pub fn empty() -> Borders
Returns an empty set of flags.
pub fn all() -> Borders
pub fn all() -> Borders
Returns the set containing all flags.
pub fn bits(&self) -> u32
pub fn bits(&self) -> u32
Returns the raw value of the flags currently stored.
pub fn from_bits(bits: u32) -> Option<Borders>
pub fn from_bits(bits: u32) -> Option<Borders>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub fn from_bits_truncate(bits: u32) -> Borders
pub fn from_bits_truncate(bits: u32) -> Borders
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if no flags are currently stored.
pub fn is_all(&self) -> bool
pub fn is_all(&self) -> bool
Returns true
if all flags are currently set.
pub fn intersects(&self, other: Borders) -> bool
pub fn intersects(&self, other: Borders) -> bool
Returns true
if there are flags common to both self
and other
.
pub fn contains(&self, other: Borders) -> bool
pub fn contains(&self, other: Borders) -> bool
Returns true
all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: Borders)
pub fn insert(&mut self, other: Borders)
Inserts the specified flags in-place.
pub fn remove(&mut self, other: Borders)
pub fn remove(&mut self, other: Borders)
Removes the specified flags in-place.
pub fn toggle(&mut self, other: Borders)
pub fn toggle(&mut self, other: Borders)
Toggles the specified flags in-place.
pub fn set(&mut self, other: Borders, value: bool)
pub fn set(&mut self, other: Borders, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations
impl Copy for Borders
impl Copy for Borders
impl PartialEq for Borders
impl PartialEq for Borders
fn eq(&self, other: &Borders) -> bool
fn eq(&self, other: &Borders) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Borders) -> bool
fn ne(&self, other: &Borders) -> bool
This method tests for !=
.
impl Eq for Borders
impl Eq for Borders
impl Clone for Borders
impl Clone for Borders
fn clone(&self) -> Borders
fn clone(&self) -> Borders
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialOrd for Borders
impl PartialOrd for Borders
fn partial_cmp(&self, other: &Borders) -> Option<Ordering>
fn partial_cmp(&self, other: &Borders) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Borders) -> bool
fn lt(&self, other: &Borders) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Borders) -> bool
fn le(&self, other: &Borders) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Borders) -> bool
fn gt(&self, other: &Borders) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Borders) -> bool
fn ge(&self, other: &Borders) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Borders
impl Ord for Borders
fn cmp(&self, other: &Borders) -> Ordering
fn cmp(&self, other: &Borders) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Hash for Borders
impl Hash for Borders
fn hash<__H: Hasher>(&self, state: &mut __H)
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for Borders
impl Debug for Borders
impl Binary for Borders
impl Binary for Borders
impl Octal for Borders
impl Octal for Borders
impl LowerHex for Borders
impl LowerHex for Borders
impl UpperHex for Borders
impl UpperHex for Borders
impl BitOr for Borders
impl BitOr for Borders
type Output = Borders
The resulting type after applying the |
operator.
fn bitor(self, other: Borders) -> Borders
fn bitor(self, other: Borders) -> Borders
Returns the union of the two sets of flags.
impl BitOrAssign for Borders
impl BitOrAssign for Borders
fn bitor_assign(&mut self, other: Borders)
fn bitor_assign(&mut self, other: Borders)
Adds the set of flags.
impl BitXor for Borders
impl BitXor for Borders
type Output = Borders
The resulting type after applying the ^
operator.
fn bitxor(self, other: Borders) -> Borders
fn bitxor(self, other: Borders) -> Borders
Returns the left flags, but with all the right flags toggled.
impl BitXorAssign for Borders
impl BitXorAssign for Borders
fn bitxor_assign(&mut self, other: Borders)
fn bitxor_assign(&mut self, other: Borders)
Toggles the set of flags.
impl BitAnd for Borders
impl BitAnd for Borders
type Output = Borders
The resulting type after applying the &
operator.
fn bitand(self, other: Borders) -> Borders
fn bitand(self, other: Borders) -> Borders
Returns the intersection between the two sets of flags.
impl BitAndAssign for Borders
impl BitAndAssign for Borders
fn bitand_assign(&mut self, other: Borders)
fn bitand_assign(&mut self, other: Borders)
Disables all flags disabled in the set.
impl Sub for Borders
impl Sub for Borders
type Output = Borders
The resulting type after applying the -
operator.
fn sub(self, other: Borders) -> Borders
fn sub(self, other: Borders) -> Borders
Returns the set difference of the two sets of flags.
impl SubAssign for Borders
impl SubAssign for Borders
fn sub_assign(&mut self, other: Borders)
fn sub_assign(&mut self, other: Borders)
Disables all flags enabled in the set.
impl Not for Borders
impl Not for Borders
type Output = Borders
The resulting type after applying the !
operator.
fn not(self) -> Borders
fn not(self) -> Borders
Returns the complement of this set of flags.
impl Extend<Borders> for Borders
impl Extend<Borders> for Borders
fn extend<T: IntoIterator<Item = Borders>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Borders>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
impl FromIterator<Borders> for Borders
impl FromIterator<Borders> for Borders
fn from_iter<T: IntoIterator<Item = Borders>>(iterator: T) -> Borders
fn from_iter<T: IntoIterator<Item = Borders>>(iterator: T) -> Borders
Creates a value from an iterator. Read more