mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
we reduce boilerplate by creating a new generic function called draw().
variables are initialized in draw_outbound(), draw_inbound(), and
draw_manual() and are then sent to draw().
dynamic resizing is enabled by returning the total frame length like so:
let len = draw_outbound(...)
let len = draw_inbound(..., len)
it would be cleaner to store this value in a struct. however this is non
trivial to implement.
ui::ui() cannot be async and therefore cannot use mutexes due to its use
in the following non-async function from external library tui::Terminal:
terminal.draw(|f| {
ui::ui(f, view.clone());
})?;
however ui::ui() is called within the async function render(), which
means values set inside ui::ui() may be overwritten during async calls.