pub struct FlashScreen<'a>(/* private fields */);
Implementations§
Source§impl<'a> FlashScreen<'a>
impl<'a> FlashScreen<'a>
Sourcepub fn expand(&self) -> Expansion<'_, FlashScreen<'_>>
pub fn expand(&self) -> Expansion<'_, FlashScreen<'_>>
Begin expanding the capability.
Examples found in repository?
examples/simple.rs (line 14)
4fn main() {
5 let info = Database::from_env().unwrap();
6
7 if let Some(cap::MaxColors(n)) = info.get::<cap::MaxColors>() {
8 println!("The terminal supports {} colors.", n);
9 } else {
10 println!("The terminal does not support colors, what year is this?");
11 }
12
13 if let Some(flash) = info.get::<cap::FlashScreen>() {
14 flash.expand().to(io::stdout()).unwrap();
15 } else {
16 println!("FLASH GORDON!");
17 }
18
19 info.get::<cap::SetAForeground>().unwrap().expand().color(2).to(io::stdout()).unwrap();
20 info.get::<cap::SetABackground>().unwrap().expand().color(4).to(io::stdout()).unwrap();
21 println!("SUP");
22 info.get::<cap::ExitAttributeMode>().unwrap().expand().to(io::stdout()).unwrap();
23}
Trait Implementations§
Source§impl<'a> AsRef<[u8]> for FlashScreen<'a>
impl<'a> AsRef<[u8]> for FlashScreen<'a>
Source§impl<'a> Capability<'a> for FlashScreen<'a>
impl<'a> Capability<'a> for FlashScreen<'a>
Source§impl<'a> Clone for FlashScreen<'a>
impl<'a> Clone for FlashScreen<'a>
Source§fn clone(&self) -> FlashScreen<'a>
fn clone(&self) -> FlashScreen<'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 FlashScreen<'a>
impl<'a> Debug for FlashScreen<'a>
Source§impl<'a> PartialEq for FlashScreen<'a>
impl<'a> PartialEq for FlashScreen<'a>
impl<'a> Eq for FlashScreen<'a>
impl<'a> StructuralPartialEq for FlashScreen<'a>
Auto Trait Implementations§
impl<'a> Freeze for FlashScreen<'a>
impl<'a> RefUnwindSafe for FlashScreen<'a>
impl<'a> Send for FlashScreen<'a>
impl<'a> Sync for FlashScreen<'a>
impl<'a> Unpin for FlashScreen<'a>
impl<'a> UnwindSafe for FlashScreen<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more