pub struct RatelClient { /* private fields */ }Expand description
Main client struct that manages the shell and PTY interface
Implementations§
Source§impl RatelClient
impl RatelClient
Sourcepub fn new(addr: String, name: Option<String>) -> Self
pub fn new(addr: String, name: Option<String>) -> Self
Examples found in repository?
examples/basic.rs (line 17)
6async fn main() -> Result<()> {
7 tracing_subscriber::fmt::init();
8
9 let args: Vec<String> = env::args().collect();
10 let addr = if args.len() > 1 {
11 args[1].clone()
12 } else {
13 "192.252.182.94:9999".to_string()
14 };
15
16 // Don't pass name - let it be randomly generated
17 let mut client = RatelClient::new(addr.clone(), None);
18
19 println!("Starting ratel client connecting to {}...", addr);
20 client.start().await?;
21
22 Ok(())
23}Sourcepub async fn start(&mut self) -> Result<()>
pub async fn start(&mut self) -> Result<()>
Examples found in repository?
examples/basic.rs (line 20)
6async fn main() -> Result<()> {
7 tracing_subscriber::fmt::init();
8
9 let args: Vec<String> = env::args().collect();
10 let addr = if args.len() > 1 {
11 args[1].clone()
12 } else {
13 "192.252.182.94:9999".to_string()
14 };
15
16 // Don't pass name - let it be randomly generated
17 let mut client = RatelClient::new(addr.clone(), None);
18
19 println!("Starting ratel client connecting to {}...", addr);
20 client.start().await?;
21
22 Ok(())
23}Auto Trait Implementations§
impl !Freeze for RatelClient
impl !RefUnwindSafe for RatelClient
impl Send for RatelClient
impl Sync for RatelClient
impl Unpin for RatelClient
impl !UnwindSafe for RatelClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more