std::mem::size_of

Function std::mem::size_of

pub fn size_of<T>() -> usize

Returns the size of a type in bytes.

More specifically, this is the offset in bytes between successive items of the same type, including alignment padding.

Examples

use std::mem;

assert_eq!(4, mem::size_of::<i32>());

© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/mem/fn.size_of.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部