update cli

This commit is contained in:
John Smith
2022-06-26 17:00:05 -04:00
parent 6daa913c68
commit dc9a5ddad2
8 changed files with 236 additions and 407 deletions

View File

@@ -14,6 +14,7 @@ use log::*;
use std::cell::RefCell;
use std::collections::{HashMap, VecDeque};
use std::rc::Rc;
use thiserror::Error;
use veilid_core::*;
//////////////////////////////////////////////////////////////
@@ -87,6 +88,12 @@ pub struct UI {
inner: Handle<UIInner>,
}
#[derive(Error, Debug)]
pub enum DumbError {
// #[error("{0}")]
// Message(String),
}
impl UI {
/////////////////////////////////////////////////////////////////////////////////////
// Private functions
@@ -642,10 +649,10 @@ impl UI {
cursive_flexi_logger_view::resize(node_log_scrollback);
// Instantiate the cursive runnable
/*
// reduces flicker, but it costs cpu
let mut runnable = CursiveRunnable::new(
|| -> Result<Box<dyn cursive_buffered_backend::Backend>, UIError> {
let runnable = CursiveRunnable::new(
|| -> Result<Box<dyn cursive_buffered_backend::Backend>, Box<DumbError>> {
let crossterm_backend = cursive::backends::crossterm::Backend::init().unwrap();
let buffered_backend =
cursive_buffered_backend::BufferedBackend::new(crossterm_backend);
@@ -653,8 +660,8 @@ impl UI {
Ok(Box::new(buffered_backend))
},
);
*/
let runnable = cursive::default();
//let runnable = cursive::default();
// Make the callback mechanism easily reachable
let cb_sink = runnable.cb_sink().clone();