notcurses/rust/examples/full-basics.rs
joseLuís 6049e07d27 rust: continue refactoring the error system.
- made const NotcursesOptions constructors.
- refactor Notcurses constructors to return NcResult.
- pass NotcursesOptions by value, since it's Copy.
- update tests.
- add helper modules for Notcurses & NcPlane.
  - new initialization functions to be used in tests.
- BONUS:
  - refactor NcDirect
  - update examples.
2020-12-25 19:35:21 +01:00

20 lines
445 B
Rust

use libnotcurses_sys::*;
fn main() -> NcResult<()> {
unsafe {
let nc = Notcurses::new()?;
let stdplane = notcurses_stdplane(nc);
for ch in "Initializing cells...".chars() {
let cell = NcCell::with_char7b(ch);
sleep![60];
ncplane_putc(&mut *stdplane, &cell);
let _ = notcurses_render(nc);
}
sleep![900];
notcurses_stop(nc);
}
Ok(())
}