Skip to main content

Module buffer

Module buffer 

Source
Expand description

An owned byte buffer with a guaranteed alignment.

Two unrelated parts of this crate need one, for the same underlying reason: a Win32 structure that a buffer merely contains still has to be aligned as though the buffer were that structure. A self-relative security descriptor requires DWORD alignment, and the directory-information classes require 8-byte alignment. A Box<[u8]> guarantees neither – its alignment is 1 – so the requirement is met explicitly here rather than assumed twice.

Structs§

AlignedBuffer
An owned, zero-initialised byte buffer aligned to a stated boundary.