index : nmrs-tui
A fast, Vim-friendly NetworkManager TUI built in Rust.
about summary refs log tree commit diff
nmrs-tui / src / app.rs
-rw-r--r-- blob 8f536670d1202d671c7a8f622d1225ac5d32f441 371 bytes (plain)
1
use anyhow::Result;
2
use crate::nm::client::NmClient;
3
4
pub struct App {
5
    pub nm: NmClient,
6
    pub should_quit: bool,
7
}
8
9
impl App {
10
    pub async fn new() -> Result<Self> {
11
        let nm = NmClient::new().await?;
12
13
        Ok(Self {
14
            nm,
15
            should_quit: false,
16
        })
17
    }
18
19
    pub fn quit(&mut self) {
20
        self.should_quit = true;
21
    }
22
}