1 个不稳定版本
使用旧的 Rust 2015
| 0.1.0 | 2017 年 6 月 23 日 |
|---|
#30 in #string-format
130KB
2.5K SLoC
bstring
bstring 库提供了两种类型,bstr 和 BString,它们实现了针对未知编码的字节字符串的类似 str 的函数。
bstring_macros 库提供了 bformat! 宏,它实现了字节字符串格式化,类似于 format!。
这些类型旨在帮助实现没有固定字符编码的基于文本的协议。
构建
要将 bstring 包含到您的项目中,请将以下内容添加到您的 Cargo.toml
[dependencies]
bstring = "0.1"
bstring_macros = "0.1"
并将以下内容添加到您的 crate 根目录
extern crate bstring;
#[macro_use] extern crate bstring_macros;
许可协议
bstring 在 MIT 许可证和 Apache 许可证(版本 2.0)的条款下分发。
有关详细信息,请参阅 LICENSE-APACHE 和 LICENSE-MIT。
lib.rs:
提供字节字符串的格式化宏
此 crate 需要 bstring 库在您的 crate 根级别声明
extern crate bstring;
#[macro_use] extern crate bstring_macros;
有关更多详细信息,请参阅 bstring::bfmt
依赖项
~1.5MB
~41K SLoC