#udp #request-response #net #tool

udp-request

A simple UDP request library for sending and receiving UDP packets, designed to handle network communication in Rust applications

14 releases

Uses new Rust 2024

0.2.2 Apr 19, 2025
0.2.1 Apr 19, 2025
0.1.4 Apr 6, 2025
0.1.2 Mar 29, 2025
0.0.6 Mar 11, 2025

#1684 in Network programming

Download history 304/week @ 2025-02-25 105/week @ 2025-03-04 104/week @ 2025-03-11 216/week @ 2025-03-18 130/week @ 2025-03-25 248/week @ 2025-04-01 122/week @ 2025-04-08 317/week @ 2025-04-15 12/week @ 2025-04-22

711 downloads per month

MIT license

17KB
400 lines

udp-request

Official Documentation

Api Docs

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