rend:面向Endian的Rust原语

时间:2021-04-19 10:34:20
【文件属性】:
文件名称:rend:面向Endian的Rust原语
文件大小:11KB
文件格式:ZIP
更新时间:2021-04-19 10:34:20
Rust 撕裂 rend是一个库,为Rust提供了可感知字节序的基元。 行动中 use rend :: * ; let little_int = i32_le :: new ( 0x12345678 ); // Internal representation is little-endian assert_eq! ([ 0x78 , 0x56 , 0x34 , 0x12 ], unsafe { :: core :: mem :: transmute :: <_, [ u8 ; 4]>(little_int) }); // Can also be made with `.into()` let little_int: i32_le = 0x12345678 . into (); // Still formats correctly assert_eq! ( "305419896" , format!
【文件预览】:
rend-master
----build.rs(645B)
----rustfmt.toml(0B)
----LICENSE(1KB)
----src()
--------validation.rs(3KB)
--------endian.rs(635B)
--------atomic.rs(6KB)
--------alias.rs(7KB)
--------lib.rs(18KB)
--------impls.rs(1KB)
----Cargo.toml(616B)
----.gitignore(19B)
----README.md(1KB)
----crates-io.md(901B)
----.vscode()
--------tasks.json(227B)

网友评论