uri_to_host_port 0.1.4

A lightweight, robust Rust utility to parse a URI and extract its host and port / 一个轻量、健壮的 Rust 工具,用于解析 URI 并提取其主机和端口
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
// 错误都用 thiserror 在 src/error.rs 中定义
// Errors are defined in src/error.rs using thiserror
use thiserror::Error;

#[derive(Error, Debug)]
pub enum Error {
  #[error("Invalid URI: {0}")]
  InvalidUri(String),

  #[error("URI is missing a host: {0}")]
  MissingHost(String),
}