| Crates.io | wheel-rs |
| lib.rs | wheel-rs |
| version | 1.1.1 |
| created_at | 2025-10-16 01:44:23.581943+00 |
| updated_at | 2026-01-04 08:15:24.792283+00 |
| description | A Rust utility library providing file operations, time utilities and Duration serialization support. |
| homepage | https://github.com/rusthing/wheel-rs |
| repository | https://github.com/rusthing/wheel-rs |
| max_upload_size | |
| id | 1885214 |
| size | 54,984 |
A Rust utility library providing various helpful utilities for common tasks.
file_utilsProvides utility functions for file operations:
get_file_ext: Extract file extension from filenamecalc_hash: Calculate SHA256 hash of a fileis_cross_device_error: Check if an IO error is a cross-device errortime_utilsTime-related utilities:
get_current_timestamp: Get current timestamp in millisecondsdns_utilsDNS resolution utilities:
parse_host: Resolve hostname to IP addressparse_host_port: Resolve hostname and port to IP address and portcmdCommand execution and process management:
exec: Execute external commandsis_process_alive: Check if a process is still runningkill_process: Kill a processserdeCustom serialization/deserialization implementations:
duration_option_serde: For Option<Duration>log_filter_option_serde: For Option<LevelFilter>vec_option_serde: For Option<Vec<String>>urn_utilsURN parsing utilities:
Urn: Parse and represent URNsMethod: HTTP method enumerationAdd this to your Cargo.toml:
[dependencies]
wheel-rs = "0.4.0"
Then use it in your code:
use wheel_rs::file_utils;
use wheel_rs::time_utils;
use wheel_rs::dns_utils;
use wheel_rs::cmd::cmd_utils;
use wheel_rs::serde::duration_option_serde;
This project is licensed under the MIT License - see the LICENSE file for details.
一个提供文件操作、时间工具和 Duration 序列化支持的 Rust 工具库。
file_utils 文件工具模块提供文件操作相关的实用工具函数:
get_file_ext: 从文件名中提取扩展名calc_hash: 计算文件的 SHA256 哈希值is_cross_device_error: 检查 IO 错误是否为跨设备错误time_utils 时间工具模块时间相关的工具函数:
get_current_timestamp: 获取当前时间戳(毫秒)dns_utils DNS 工具模块DNS 解析工具函数:
parse_host: 将主机名解析为 IP 地址parse_host_port: 将主机名和端口解析为 IP 地址和端口cmd 命令执行模块命令执行和进程管理工具函数:
exec: 执行外部命令is_process_alive: 检查进程是否仍在运行kill_process: 杀死进程serde 序列化模块自定义序列化/反序列化实现:
duration_option_serde: 用于 Option<Duration>log_filter_option_serde: 用于 Option<LevelFilter>vec_option_serde: 用于 Option<Vec<String>>urn_utils URN 解析模块URN 解析工具函数:
Urn: 解析和表示 URNsMethod: HTTP 方法枚举将以下内容添加到您的 Cargo.toml 文件中:
[dependencies]
wheel-rs = "0.4.0"
然后在您的代码中使用:
use wheel_rs::file_utils;
use wheel_rs::time_utils;
use wheel_rs::dns_utils;
use wheel_rs::cmd::cmd_utils;
use wheel_rs::serde::duration_option_serde;
本项目采用 MIT 许可证,详情请参见 LICENSE 文件。