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());

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());

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);

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());

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());

The resulting type after applying the ^ operator.

Performs the ^ operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Implement Default for Attributes

Example

use pancurses::Attributes;
let attributes: Attributes = Default::default();
assert_eq!(attributes, Attributes::new());

Returns the “default value” for a type. Read more

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.