[go: up one dir, main page]

typesize 0.1.3

A library to fetch an accurate estimate of the total memory usage of a value.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use secrecy::{zeroize::Zeroize, ExposeSecret};

use crate::TypeSize;

impl<T: Zeroize + TypeSize> TypeSize for secrecy::Secret<T> {
    fn extra_size(&self) -> usize {
        self.expose_secret().extra_size()
    }

    #[cfg(feature = "details")]
    fn get_collection_item_count(&self) -> Option<usize> {
        self.expose_secret().get_collection_item_count()
    }
}