10 个版本 (3 个稳定版)
1.2.0 | 2024 年 5 月 7 日 |
---|---|
1.1.91 | 2019 年 8 月 22 日 |
0.1.7 | 2019 年 3 月 3 日 |
0.1.6 | 2018 年 11 月 10 日 |
0.1.3 | 2018 年 4 月 16 日 |
#261 in FFI
每月 642 次下载
用于 cluuname
16KB
260 行
注意
从 Rust 1.77.0 开始,您可以使用 c"wow"
代替此 crate 中的 cstr!("wow")
。这个新功能提供了更简洁的代码和更快的编译速度。如果您正在使用较旧的 Rust API(如 1.66),此 crate 仍将在一段时间内保持相关性。
用法
将其添加到您的 Cargo.toml 中
[dependencies]
clucstr = "1.2.0"
并将其添加到您的源代码中
use cluCStr::cstr;
use core::ffi::CStr;
示例
use cluCStr::cstr;
use core::ffi::CStr;
fn main() {
let cstr = cstr!(b"How are you?");
assert_eq!(cstr.to_bytes_with_nul(), b"How are you?\0");
}
查看全部
许可证
此项目只有一个许可证(LICENSE-APACHE-2.0)。
Apache 许可证
依赖项
~125–330KB