Struct terminfo::capability::SetAttributes
source · pub struct SetAttributes<'a>(_);
Implementations§
source§impl<'a> SetAttributes<'a>
impl<'a> SetAttributes<'a>
sourcepub fn expand(&self) -> Expansion<'_, SetAttributes<'_>>
pub fn expand(&self) -> Expansion<'_, SetAttributes<'_>>
Begin expanding the capability.
Examples found in repository?
examples/set_attributes.rs (line 12)
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
fn main() {
let info = Database::from_env().unwrap();
if let Some(set_attributes) = info.get::<cap::SetAttributes>() {
let clear = info.get::<cap::ExitAttributeMode>().unwrap();
set_attributes.expand()
.bold(true)
.underline(true)
.to(io::stdout())
.unwrap();
println!("bold and underline");
clear.expand().to(io::stdout()).unwrap();
} else {
println!("The terminal does not support mass-setting attributes");
}
}
Trait Implementations§
source§impl<'a> AsRef<[u8]> for SetAttributes<'a>
impl<'a> AsRef<[u8]> for SetAttributes<'a>
source§impl<'a> Capability<'a> for SetAttributes<'a>
impl<'a> Capability<'a> for SetAttributes<'a>
source§impl<'a> Clone for SetAttributes<'a>
impl<'a> Clone for SetAttributes<'a>
source§fn clone(&self) -> SetAttributes<'a>
fn clone(&self) -> SetAttributes<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for SetAttributes<'a>
impl<'a> Debug for SetAttributes<'a>
source§impl<'a> PartialEq<SetAttributes<'a>> for SetAttributes<'a>
impl<'a> PartialEq<SetAttributes<'a>> for SetAttributes<'a>
source§fn eq(&self, other: &SetAttributes<'a>) -> bool
fn eq(&self, other: &SetAttributes<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.