Registry / utility / memoffset

memoffset

JSON →
library0.9.1rscratesunverified

Provides `offset_of!` macro for computing the byte offset of a struct field.

# Cargo.toml [dependencies] memoffset = "0.9.1"
INSTALL
IMPORT
SIG · MEMOFFSET
M
memoffset
utilityrustv0.9.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

offset_of
use memoffset::offset_of;

Computes the offset of field `b` in struct `Example`.

use memoffset::offset_of; struct Example { a: u8, b: u32, } fn main() { let offset = offset_of!(Example, b); println!("Offset of b: {}", offset); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.9.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
memoffset — cargo add memoffset · libregistry