5 releases
new 0.0.5 | Mar 4, 2025 |
---|---|
0.0.4 | Mar 2, 2025 |
0.0.3 | Mar 2, 2025 |
0.0.2 | Mar 2, 2025 |
0.0.1 | Mar 2, 2025 |
#1921 in Network programming
384 downloads per month
18KB
417 lines
udp-request
A simple UDP request library for sending and receiving UDP packets, designed to handle network communication in Rust applications.
Installation
To use this crate, you can run cmd:
cargo add udp-request
Use
Receive Text
use udp_request::*;
let mut request_builder = RequestBuilder::new()
.host("127.0.0.1")
.port(80)
.build();
request_builder
.send("udp send".as_bytes())
.and_then(|response| {
println!("ResponseTrait => {:?}", response.text());
Ok(())
})
.unwrap_or_else(|e| println!("Error => {:?}", e));
Receive Binary
use udp_request::*;
let mut request_builder = RequestBuilder::new()
.host("127.0.0.1")
.port(80)
.build();
request_builder
.send("udp send".as_bytes())
.and_then(|response| {
println!("ResponseTrait => {:?}", response.binary());
Ok(())
})
.unwrap_or_else(|e| println!("Error => {:?}", e));
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
Contact
For any inquiries, please reach out to the author at ltpp-universe root@ltpp.vip.
Dependencies
~195–630KB
~15K SLoC