Struct Boolean

Source
pub struct Boolean(/* private fields */);
Expand description

Boolean capability names.

The names are used as indices into a Desc.

NameShort name
auto_left_marginbw
auto_right_marginam
no_esc_ctlcxsb
ceol_standout_glitchxhp
eat_newline_glitchxenl
erase_overstrikeeo
generic_typegn
hard_copyhc
has_meta_keykm
has_status_linehs
insert_null_glitchin_
memory_abovedb
memory_belowda
move_insert_modemir
move_standout_modemsgr
over_strikeos
status_line_esc_okeslok
dest_tabs_magic_smsoxt
tilde_glitchhz
transparent_underlineul
xon_xoffxon
needs_xon_xoffnxon
prtr_silentmc5i
hard_cursorchts
non_rev_rmcupnrrmc
no_pad_charnpc
non_dest_scroll_regionndscr
can_changeccc
back_color_erasebce
hue_lightness_saturationhls
col_addr_glitchxhpa
cr_cancels_micro_modecrxm
has_print_wheeldaisy
row_addr_glitchxvpa
semi_auto_right_marginsam
cpi_changes_rescpix
lpi_changes_reslpix
backspaces_with_bsOTbs_b
crt_no_scrollingOTns
no_correctly_working_crOTnc
gnu_has_meta_keyOTMT
linefeed_is_newlineOTNL
has_hardware_tabsOTpt
return_does_clr_eolOTxr

Implementations§

Source§

impl Boolean

Source

pub fn named<T: Borrow<str>>(name: T) -> Option<Boolean>

The Boolean capabilitiy name corresponding to the string name.

Source

pub fn iter() -> BoolIter

An iterator over the predefined boolean capabilities.

Examples found in repository?
examples/dumpinfo.rs (line 11)
5fn main() {
6    let desc = Desc::current();
7    let names = desc.names();
8    if names.len() > 0 {
9        println!("{}", names[0]);
10    }
11    for b in cap::Boolean::iter() {
12        if desc[b] {
13            println!("{}", b.short_name());
14        }
15    }
16    for b in desc.bool_exts() {
17        if desc.get_bool_ext(b) {
18            println!("* {}", b.name());
19        }
20    }
21    for n in cap::Number::iter() {
22        if desc[n] != 0xffff {
23            println!("{}#{}", n.short_name(), desc[n]);
24        }
25    }
26    for n in desc.num_exts() {
27        if desc.get_num_ext(n) != 0xffff {
28            println!("* {}#{}", n.name(), desc.get_num_ext(n));
29        }
30    }
31    for s in cap::String::iter() {
32        if &desc[s] != b"" {
33            println!("{}={}", s.short_name(), show(&desc[s]));
34        }
35    }
36    for s in desc.str_exts() {
37        if desc.get_str_ext(s) != b"" {
38            println!("* {}={}", s.name(), show(desc.get_str_ext(s)));
39        }
40    }
41}
Source

pub fn short_name(&self) -> &'static str

The short name of the capability.

Examples found in repository?
examples/dumpinfo.rs (line 13)
5fn main() {
6    let desc = Desc::current();
7    let names = desc.names();
8    if names.len() > 0 {
9        println!("{}", names[0]);
10    }
11    for b in cap::Boolean::iter() {
12        if desc[b] {
13            println!("{}", b.short_name());
14        }
15    }
16    for b in desc.bool_exts() {
17        if desc.get_bool_ext(b) {
18            println!("* {}", b.name());
19        }
20    }
21    for n in cap::Number::iter() {
22        if desc[n] != 0xffff {
23            println!("{}#{}", n.short_name(), desc[n]);
24        }
25    }
26    for n in desc.num_exts() {
27        if desc.get_num_ext(n) != 0xffff {
28            println!("* {}#{}", n.name(), desc.get_num_ext(n));
29        }
30    }
31    for s in cap::String::iter() {
32        if &desc[s] != b"" {
33            println!("{}={}", s.short_name(), show(&desc[s]));
34        }
35    }
36    for s in desc.str_exts() {
37        if desc.get_str_ext(s) != b"" {
38            println!("* {}={}", s.name(), show(desc.get_str_ext(s)));
39        }
40    }
41}
Source

pub fn long_name(&self) -> &'static str

The long name of the capability.

Trait Implementations§

Source§

impl Clone for Boolean

Source§

fn clone(&self) -> Boolean

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Boolean

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Index<Boolean> for Desc

Source§

fn index(&self, idx: Boolean) -> &bool

The value of the boolean capability named by index.

Source§

type Output = bool

The returned type after indexing.
Source§

impl Copy for Boolean

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.