port-desc

Crates.ioport-desc
lib.rsport-desc
version0.1.1
sourcesrc
created_at2024-08-16 21:24:09.889431
updated_at2024-08-17 19:53:42.443775
descriptionPort service description library from internet assigned number authority
homepage
repositoryhttps://github.com/chleba/port-desc
max_upload_size
id1341009
size1,159,604
Chleba (Chleba)

documentation

README

port-desc

Port service description library from internet assigned number authority

Usage

Include in the Cargo.toml file:

port-desc = { version = "0.1.1" }

then

use port_desc::{PortDescription, TransportProtocol};

fn main() {
    let ports = PortDescription::defult();
    match ports {
        Ok(p) => {
            let port_num = 80;
            let entry = p.get_port_service_name(port_num, TransportProtocol::Tcp);
            println!("TCP Port {} service name: {}", port_num, entry);
        },
        Err(e) => {
            println!("{:?}", e);
        }
    }
}

You can always take a look at examples files.

Commit count: 0

cargo fmt