ratel_rust/
lib.rs

1pub mod model;
2pub mod network;
3pub mod pty;
4pub mod shell;
5pub mod util;
6
7pub use model::*;
8pub use network::{Connection, NetType};
9pub use shell::Shell;
10
11use anyhow::Result;
12
13/// Main client struct that manages the shell and PTY interface
14pub struct RatelClient {
15    shell: Shell,
16}
17
18impl RatelClient {
19    pub fn new(addr: String, name: Option<String>) -> Self {
20        let name = name.unwrap_or_else(|| util::random_name());
21        Self {
22            shell: Shell::new(addr, name),
23        }
24    }
25
26    pub async fn start(&mut self) -> Result<()> {
27        self.shell.start().await
28    }
29}