Function std::intrinsics::size_of[][src]

pub const extern "rust-intrinsic" fn size_of<T>() -> usize
🔬 This is a nightly-only experimental API. (core_intrinsics)

intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library

Expand description

类型的大小 (以字节为单位)。

请注意,与大多数内联函数不同,这对调用是安全的; 它不需要 unsafe 块。 因此,实现不得要求用户维护任何安全不可变变量。

更具体地说,这是相同类型的连续项之间的字节偏移量,包括对齐填充。

这个 intrinsic 的稳定版本是 core::mem::size_of