7 个版本 (破坏性更新)

0.6.0 2024 年 5 月 11 日
0.5.0 2024 年 3 月 16 日
0.4.0 2024 年 3 月 16 日
0.3.0 2024 年 3 月 16 日
0.1.0 2022 年 6 月 26 日

#1115开发工具

Download history 820/week @ 2024-05-01 1575/week @ 2024-05-08 918/week @ 2024-05-15 559/week @ 2024-05-22 1375/week @ 2024-05-29 633/week @ 2024-06-05 421/week @ 2024-06-12 296/week @ 2024-06-19 359/week @ 2024-06-26 326/week @ 2024-07-03 341/week @ 2024-07-10 602/week @ 2024-07-17 319/week @ 2024-07-24 341/week @ 2024-07-31 391/week @ 2024-08-07 473/week @ 2024-08-14

1,656 每月下载量
用于 91 个 Crates (4 个直接使用)

MIT 许可证

10KB
111 代码行

模块 :: mem_tools

experimental rust-status docs.rs Open in Gitpod discord

内存操作工具集合。

高效的尺寸/指针/区域/数据比较。

基本用例


use mem_tools as mem;

// Are two pointers are the same, not taking into accoint type.
// Unlike `std::ptr::eq()` does not require arguments to have the same type.
let src1 = ( 1, );
let src2 = ( 1, );
assert!( !mem::same_ptr( &src1, &src2 ) );

// Are two pointers points on data of the same size.
let src1 = "abc";
let src2 = "cba";
assert!( mem::same_size( src1, src2 ) );

// Are two pointers points on the same region, ie same size and same pointer.
// Does not require arguments to have the same type.
let src1 = "abc";
let src2 = "abc";
assert!( mem::same_region( src1, src2 ) );

添加到您的项目

cargo add mem_tools

从仓库中尝试

git clone https://github.com/Wandalen/wTools
cd wTools
cd examples/mem_tools_trivial
cargo run

示例

discord Open in Gitpod docs.rs docs.rs](https://docs.rs/meta_tools)

无运行时依赖