6个版本
| 新版本 0.1.5 | 2024年8月1日 |
|---|---|
| 0.1.4 | 2024年7月19日 |
| 0.1.2 | 2024年6月24日 |
| 0.1.1 | 2024年5月18日 |
| 0.1.0 | 2024年4月21日 |
#1750 in 解析器实现
685 每月下载量
用于 31 个crate(10个直接)
58KB
1K SLoC
IROX-BITS
位与碎片。无std/无分配的流位/字节操作。
此crate提供的主要特质是 Bits(类似于 std::io::Read),以及 MutBits(类似于 std::io::Write)。
还包括多操作系统包装器 SeekRead 和 SeekWrite,以及字符的更自然的UTF-8编码/解码设置。
这是一个IROX基础crate,没有外部依赖,默认为no-std/no-alloc(但可以通过使用std和alloc功能进行增强),并且许多其他irox crate扩展并增强了其中的功能。《irox_structs》是显著的,因为它提供了一种可派生的方式来将结构体编码/解码为字节序列。
无STD支持
特性
alloc:- 启用在
alloc包中的类型上实现Bits和MutBits - 启用以下附加方法
- [
Bits::read_u8_blob()] ->Vec<u8> - [
Bits::read_be_u16_blob()]/[Bits::read_le_u16_blob()] ->Vec<u16> - [
Bits::read_be_u32_blob()]/[Bits::read_le_u32_blob()] ->Vec<u32> - [
Bits::read_be_u64_blob()]/[Bits::read_le_u64_blob()] ->Vec<u64> - [
Bits::read_all_vec()] ->Vec<u8> - [
Bits::read_exact_vec()] ->Vec<u8> - [
Bits::read_all_str_lossy()] ->alloc::string::String - [
Bits::read_str_sized_lossy()] ->alloc::string::String - [
Bits::read_str_u32_blob()] ->alloc::string::String - [
Bits::read_until()] ->Vec<u8> - [[
Bits::consume_until()]] ->() - [[
MutBits::write_fmt_impl()]]
- [
- 启用在
std:- 允许在
std包的类型上实现Bits和MutBits - 同时允许使用
SeekRead和SeekWrite特性,它们封装并规范化 - 允许
std::error::Error与BitsError的兼容性 - 允许 (几乎) 无缝地在
std::io::Error/BitsError和std::io::ErrorKind/BitsErrorKind之间转换
- 允许在