Struct pancurses::Attributes [−][src]
pub struct Attributes { /* fields omitted */ }
Implementations
Trait Implementations
Implement the | operator for adding an Attribute to Attributes
Example
use pancurses::{Attribute, Attributes};
let mut attributes = Attributes::new();
assert!(!attributes.is_bold());
attributes = attributes | Attribute::Bold;
assert!(attributes.is_bold());
type Output = Attributes
type Output = Attributes
The resulting type after applying the |
operator.
Performs the |
operation. Read more
Implement the | operator for adding Attributes to Attributes
Example
use pancurses::{Attribute, Attributes};
let mut attributes = Attributes::new() | Attribute::Bold;
let other = Attributes::new() | Attribute::Reverse;
attributes = attributes | other;
assert!(attributes.is_bold());
assert!(attributes.is_reverse());
assert!(!attributes.is_italic());
type Output = Attributes
type Output = Attributes
The resulting type after applying the |
operator.
Performs the |
operation. Read more
Implement the | operator for setting a color pair on an Attributes
object
Example
use pancurses::{Attribute, Attributes};
use pancurses::colorpair::ColorPair;
let mut attributes = Attributes::new();
assert!(attributes.color_pair().0 == 0);
attributes = attributes | ColorPair(1);
assert!(attributes.color_pair().0 == 1);
type Output = Attributes
type Output = Attributes
The resulting type after applying the |
operator.
Performs the |
operation. Read more
Implement the ^ operator for disabling an Attribute from Attributes
Example
use pancurses::{Attribute, Attributes};
let mut attributes = Attributes::from(Attribute::Bold);
assert!(attributes.is_bold());
attributes = attributes ^ Attribute::Bold;
assert!(!attributes.is_bold());
type Output = Attributes
type Output = Attributes
The resulting type after applying the ^
operator.
Performs the ^
operation. Read more
Implement the ^ operator for removing Attributes from Attributes
Example
use pancurses::{Attribute, Attributes};
let mut attributes = Attributes::new() | Attribute::Blink | Attribute::Bold;
let other = Attributes::new() | Attribute::Reverse | Attribute::Bold;
attributes = attributes ^ other;
assert!(!attributes.is_bold());
assert!(attributes.is_reverse());
assert!(attributes.is_blink());
type Output = Attributes
type Output = Attributes
The resulting type after applying the ^
operator.
Performs the ^
operation. Read more
Implement Default for Attributes
Example
use pancurses::Attributes;
let attributes: Attributes = Default::default();
assert_eq!(attributes, Attributes::new());
Performs the conversion.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for Attributes
impl Send for Attributes
impl Sync for Attributes
impl Unpin for Attributes
impl UnwindSafe for Attributes
Blanket Implementations
Mutably borrows from an owned value. Read more