Trait get_size::GetSize

source ·
pub trait GetSize: Sized {
    // Provided methods
    fn get_stack_size() -> usize { ... }
    fn get_heap_size(&self) -> usize { ... }
    fn get_size(&self) -> usize { ... }
}
Expand description

Determine the size in bytes an object occupies inside RAM.

Provided Methods§

source

fn get_stack_size() -> usize

Determines how may bytes this object occupies inside the stack.

The default implementation uses std::mem::size_of and should work for almost all types.

source

fn get_heap_size(&self) -> usize

Determines how many bytes this object occupies inside the heap.

The default implementation returns 0, assuming the object is fully allocated on the stack. It must be adjusted as appropriate for objects which hold data inside the heap.

source

fn get_size(&self) -> usize

Determines the total size of the object.

The default implementation simply adds up the result of the other two methods and is not meant to be changed.

Implementations on Foreign Types§

source§

impl<T> GetSize for Mutex<T>where T: GetSize,

source§

impl<T, const SIZE: usize> GetSize for [T; SIZE]where T: GetSize,

source§

impl<T> GetSize for VecDeque<T>where T: GetSize,

source§

impl<V1, V2, V3, V4, V5, V6, V7, V8, V9, V10> GetSize for (V1, V2, V3, V4, V5, V6, V7, V8, V9, V10)where V1: GetSize, V2: GetSize, V3: GetSize, V4: GetSize, V5: GetSize, V6: GetSize, V7: GetSize, V8: GetSize, V9: GetSize, V10: GetSize,

source§

impl<T> GetSize for Box<T>where T: GetSize,

source§

impl<K, V> GetSize for BTreeMap<K, V>where K: GetSize, V: GetSize,

source§

impl GetSize for ReadDir

source§

impl GetSize for OsString

source§

impl<T> GetSize for Box<[T]>

source§

impl GetSize for File

source§

impl<'a, T> GetSize for Cow<'a, T>where T: ToOwned, <T as ToOwned>::Owned: GetSize,

source§

impl GetSize for u8

source§

impl GetSize for AtomicIsize

source§

impl<T> GetSize for *mut T

source§

impl GetSize for AtomicUsize

source§

impl GetSize for NonZeroIsize

source§

impl GetSize for &Path

source§

impl<V1, V2, V3> GetSize for (V1, V2, V3)where V1: GetSize, V2: GetSize, V3: GetSize,

source§

impl GetSize for &str

source§

impl GetSize for AtomicI8

source§

impl GetSize for usize

source§

impl GetSize for FileType

source§

impl GetSize for i64

source§

impl GetSize for Infallible

source§

impl<T> GetSize for LinkedList<T>where T: GetSize,

source§

impl GetSize for Metadata

source§

impl<V1, V2, V3, V4, V5> GetSize for (V1, V2, V3, V4, V5)where V1: GetSize, V2: GetSize, V3: GetSize, V4: GetSize, V5: GetSize,

source§

impl GetSize for i128

source§

impl GetSize for Permissions

source§

impl<V1, V2, V3, V4, V5, V6> GetSize for (V1, V2, V3, V4, V5, V6)where V1: GetSize, V2: GetSize, V3: GetSize, V4: GetSize, V5: GetSize, V6: GetSize,

source§

impl GetSize for String

source§

impl GetSize for NonZeroU16

source§

impl GetSize for Instant

source§

impl<T> GetSize for Arc<T>where T: GetSize,

source§

impl GetSize for NonZeroUsize

source§

impl<T> GetSize for &mut T

source§

impl GetSize for &CStr

source§

impl GetSize for f64

source§

impl<T> GetSize for HashSet<T>where T: GetSize,

source§

impl<T> GetSize for Option<T>where T: GetSize,

source§

impl GetSize for AtomicI16

source§

impl GetSize for NonZeroU8

source§

impl GetSize for OpenOptions

source§

impl GetSize for NonZeroU64

source§

impl GetSize for AtomicU16

source§

impl<V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13> GetSize for (V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13)where V1: GetSize, V2: GetSize, V3: GetSize, V4: GetSize, V5: GetSize, V6: GetSize, V7: GetSize, V8: GetSize, V9: GetSize, V10: GetSize, V11: GetSize, V12: GetSize, V13: GetSize,

source§

impl GetSize for u32

source§

impl<V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11> GetSize for (V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11)where V1: GetSize, V2: GetSize, V3: GetSize, V4: GetSize, V5: GetSize, V6: GetSize, V7: GetSize, V8: GetSize, V9: GetSize, V10: GetSize, V11: GetSize,

source§

impl GetSize for AtomicU32

source§

impl<T> GetSize for &[T]where T: GetSize,

source§

impl GetSize for DirBuilder

source§

impl<T> GetSize for *const T

source§

impl<T> GetSize for Vec<T>where T: GetSize,

source§

impl GetSize for AtomicBool

source§

impl<T, E> GetSize for Result<T, E>where T: GetSize, E: GetSize,

source§

impl GetSize for AtomicI64

source§

impl<V1> GetSize for (V1,)where V1: GetSize,

source§

impl GetSize for AtomicU8

source§

impl<T> GetSize for BufWriter<T>where T: GetSize + Write,

source§

impl GetSize for u128

source§

impl GetSize for NonZeroI64

source§

impl<V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13, V14> GetSize for (V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13, V14)where V1: GetSize, V2: GetSize, V3: GetSize, V4: GetSize, V5: GetSize, V6: GetSize, V7: GetSize, V8: GetSize, V9: GetSize, V10: GetSize, V11: GetSize, V12: GetSize, V13: GetSize, V14: GetSize,

source§

impl GetSize for Ordering

source§

impl<V1, V2, V3, V4, V5, V6, V7, V8> GetSize for (V1, V2, V3, V4, V5, V6, V7, V8)where V1: GetSize, V2: GetSize, V3: GetSize, V4: GetSize, V5: GetSize, V6: GetSize, V7: GetSize, V8: GetSize,

source§

impl GetSize for char

source§

impl GetSize for PhantomPinned

source§

impl GetSize for AtomicU64

source§

impl GetSize for NonZeroI16

source§

impl GetSize for &OsStr

source§

impl GetSize for bool

source§

impl GetSize for NonZeroU128

source§

impl<V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12> GetSize for (V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12)where V1: GetSize, V2: GetSize, V3: GetSize, V4: GetSize, V5: GetSize, V6: GetSize, V7: GetSize, V8: GetSize, V9: GetSize, V10: GetSize, V11: GetSize, V12: GetSize,

source§

impl<V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13, V14, V15> GetSize for (V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13, V14, V15)where V1: GetSize, V2: GetSize, V3: GetSize, V4: GetSize, V5: GetSize, V6: GetSize, V7: GetSize, V8: GetSize, V9: GetSize, V10: GetSize, V11: GetSize, V12: GetSize, V13: GetSize, V14: GetSize, V15: GetSize,

source§

impl<V1, V2, V3, V4> GetSize for (V1, V2, V3, V4)where V1: GetSize, V2: GetSize, V3: GetSize, V4: GetSize,

source§

impl<T> GetSize for PhantomData<T>

source§

impl GetSize for AtomicI32

source§

impl<T> GetSize for &T

source§

impl<T> GetSize for RwLock<T>where T: GetSize,

source§

impl GetSize for SystemTime

source§

impl GetSize for i8

source§

impl<T> GetSize for BufReader<T>where T: GetSize,

source§

impl GetSize for CString

source§

impl GetSize for f32

source§

impl GetSize for Duration

source§

impl GetSize for NonZeroI32

source§

impl GetSize for NonZeroI8

source§

impl<V1, V2, V3, V4, V5, V6, V7> GetSize for (V1, V2, V3, V4, V5, V6, V7)where V1: GetSize, V2: GetSize, V3: GetSize, V4: GetSize, V5: GetSize, V6: GetSize, V7: GetSize,

source§

impl GetSize for u64

source§

impl GetSize for PathBuf

source§

impl<V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13, V14, V15, V16> GetSize for (V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12, V13, V14, V15, V16)where V1: GetSize, V2: GetSize, V3: GetSize, V4: GetSize, V5: GetSize, V6: GetSize, V7: GetSize, V8: GetSize, V9: GetSize, V10: GetSize, V11: GetSize, V12: GetSize, V13: GetSize, V14: GetSize, V15: GetSize, V16: GetSize,

source§

impl GetSize for i16

source§

impl<T> GetSize for Rc<T>where T: GetSize,

source§

impl GetSize for isize

source§

impl GetSize for NonZeroU32

source§

impl GetSize for ()

source§

impl<T> GetSize for BTreeSet<T>where T: GetSize,

source§

impl<T> GetSize for BinaryHeap<T>where T: GetSize,

source§

impl GetSize for u16

source§

impl GetSize for i32

source§

impl<V1, V2, V3, V4, V5, V6, V7, V8, V9> GetSize for (V1, V2, V3, V4, V5, V6, V7, V8, V9)where V1: GetSize, V2: GetSize, V3: GetSize, V4: GetSize, V5: GetSize, V6: GetSize, V7: GetSize, V8: GetSize, V9: GetSize,

source§

impl<V1, V2> GetSize for (V1, V2)where V1: GetSize, V2: GetSize,

source§

impl GetSize for Ordering

source§

impl GetSize for DirEntry

source§

impl<K, V> GetSize for HashMap<K, V>where K: GetSize, V: GetSize,

source§

impl GetSize for NonZeroI128

Implementors§