use-socket 0.1.0

Socket endpoint parsing and formatting helpers for RustUse.
Documentation
  • Coverage
  • 100%
    10 out of 10 items documented1 out of 8 items with examples
  • Size
  • Source code size: 7.63 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 339.97 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • RustUse/use-net
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-socket

use-socket provides small helpers for parsing and formatting host-and-port endpoints.

Experimental: this crate is below 0.3.0 and the API may change.

Example Usage

use use_socket::{format_socket_endpoint, parse_socket_endpoint};

let endpoint = parse_socket_endpoint("[::1]:8080").unwrap();

assert_eq!(endpoint.host, "::1");
assert_eq!(format_socket_endpoint(&endpoint), "[::1]:8080");

Scope

  • Parsing host-and-port endpoints.
  • Formatting endpoints with proper IPv6 bracket handling.
  • Simple host and port splitting helpers.

Non-goals

  • Opening sockets.
  • Async socket handling.
  • Unix sockets.
  • Socket options.

License

Licensed under MIT OR Apache-2.0.