udp-request

Crates.ioudp-request
lib.rsudp-request
version0.3.3
created_at2025-03-02 05:10:59.421995+00
updated_at2025-08-02 07:00:50.028939+00
descriptionA simple UDP request library for sending and receiving UDP packets, designed to handle network communication in Rust applications.
homepage
repositoryhttps://github.com/crates-dev/udp-request.git
max_upload_size
id1574276
size27,048
尤雨东 (eastspire)

documentation

README

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 root@ltpp.vip.

Commit count: 0

cargo fmt