| Crates.io | utils-box-connections |
| lib.rs | utils-box-connections |
| version | 1.0.1 |
| created_at | 2025-11-03 07:35:07.163568+00 |
| updated_at | 2025-11-03 07:35:07.163568+00 |
| description | A toolbox of various small RUST utilities that make our lifes easier |
| homepage | |
| repository | https://github.com/klispap/utils-box |
| max_upload_size | |
| id | 1914080 |
| size | 48,089 |
A toolbox library that holds a useful collection of small unitilies written in Rust that make our life easier when writting Rust applications.
Connect via SSH to a server to perform commands, upload & download files
Mininal Example:
let ssh = SshClient::local("user".to_string(), "1234".to_string()).unwrap();
let stdout = ssh.execute_cmd("ls").unwrap();
println!("{:?}", stdout);
Connect via TCP to a socket to send and receive data
Mininal Example:
let mut tcp_client = TcpClient::new("192.168.1.17".to_string(), 36457)?;
let data: Vec<u8> = vec![8, 30, 15, 30, 5, 19, 0, 7];
tcp_client.send(&data)?;
// Block and wait for response
let resp = tcp_client.receive()?;
println!("{:?}", resp);
Connect via UDP to a socket to send and receive data
Mininal Example:
let mut udp =
UdpClient::new("0.0.0.0".to_string(), "192.168.1.31".to_string(), 6123).unwrap();
udp.send(b"\r").unwrap();
// Block and wait for response
let data = udp.receive().unwrap();
println!("{:?} => {}", data, String::from_utf8_lossy(&data));
Connect to a ZMQ server to send and receive data
Mininal Example:
let zmq_client = ZmqClient::new(("192.168.1.17".to_string(), 36457)?;
let data: Vec<u8> = vec![8, 30, 15, 30, 5, 19, 0, 7];
zmq_client.send(&data)?;
// Block and wait for response
let resp = zmq_client.receive()?;
println!("{:?}", resp);
Make sure you have the following system-level dependencies installed:
sudo apt install pkg-config build-essential fontconfig libfontconfig1-dev
Verify that pkg-config can detect libstdc++ properly:
pkg-config --libs libstdc++
If libstdc++ is not detected, add the symbolic link:
sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/11/libstdc++.so /usr/lib/libstdc++.so