alignof can be used to get the minimum alignment of type in bytes.
alignof
alignof Type
The resulting value will be a usize that is the minimum alignment of the type in bytes.
usize
import basics func main { printf("Alignment of String is %zu bytes\n", alignof String) }
Alignment of String 8 bytes
There was an error while loading. Please reload this page.
Table of Contents