pub trait GetSize {
const USES_DYN_MEM: bool = false;
// Provided methods
fn size_bytes_dyn(&self) -> usize { ... }
fn size_bytes_content_dyn(&self) -> usize { ... }
fn size_bytes(&self) -> usize { ... }
}Expand description
Provides methods to get dynamic and total size of the variable.
Provided Associated Constants§
Sourceconst USES_DYN_MEM: bool = false
const USES_DYN_MEM: bool = false
true if and only if the variables of this type can use dynamic (heap) memory.
Provided Methods§
Sourcefn size_bytes_dyn(&self) -> usize
fn size_bytes_dyn(&self) -> usize
Returns approximate number of bytes occupied by dynamic (heap) part of self.
Same as self.size_bytes() - std::mem::size_of_val(self).
Sourcefn size_bytes_content_dyn(&self) -> usize
fn size_bytes_content_dyn(&self) -> usize
Returns approximate number of bytes occupied by dynamic (heap) part of self content.
It usually equals to size_bytes_dyn().
However, sometimes it is smaller by the amount of memory reserved but not yet used
(e.g., size_bytes_content_dyn() only takes into account the length of the vector and not its capacity).
Sourcefn size_bytes(&self) -> usize
fn size_bytes(&self) -> usize
Returns approximate, total (including heap memory) number of bytes occupied by self.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
impl GetSize for bool
impl GetSize for char
impl GetSize for f32
impl GetSize for f64
impl GetSize for i8
impl GetSize for i16
impl GetSize for i32
impl GetSize for i64
impl GetSize for i128
impl GetSize for isize
impl GetSize for u8
impl GetSize for u16
impl GetSize for u32
impl GetSize for u64
impl GetSize for u128
impl GetSize for ()
impl GetSize for usize
impl GetSize for AtomicBool
impl GetSize for AtomicI8
impl GetSize for AtomicI16
impl GetSize for AtomicI32
impl GetSize for AtomicI64
impl GetSize for AtomicIsize
impl GetSize for AtomicU8
impl GetSize for AtomicU16
impl GetSize for AtomicU32
impl GetSize for AtomicU64
impl GetSize for AtomicUsize
impl GetSize for BinaryRankSearch
Source§impl<A> GetSize for (A,)where
A: GetSize,
impl<A> GetSize for (A,)where
A: GetSize,
const USES_DYN_MEM: bool = A::USES_DYN_MEM
fn size_bytes_dyn(&self) -> usize
fn size_bytes_content_dyn(&self) -> usize
Source§impl<A, B> GetSize for (A, B)
impl<A, B> GetSize for (A, B)
const USES_DYN_MEM: bool
fn size_bytes_dyn(&self) -> usize
fn size_bytes_content_dyn(&self) -> usize
Source§impl<A, B, C> GetSize for (A, B, C)
impl<A, B, C> GetSize for (A, B, C)
const USES_DYN_MEM: bool
fn size_bytes_dyn(&self) -> usize
fn size_bytes_content_dyn(&self) -> usize
Source§impl<A, B, C, D> GetSize for (A, B, C, D)
impl<A, B, C, D> GetSize for (A, B, C, D)
const USES_DYN_MEM: bool
fn size_bytes_dyn(&self) -> usize
fn size_bytes_content_dyn(&self) -> usize
Source§impl<A, B, C, D, E> GetSize for (A, B, C, D, E)
impl<A, B, C, D, E> GetSize for (A, B, C, D, E)
const USES_DYN_MEM: bool
fn size_bytes_dyn(&self) -> usize
fn size_bytes_content_dyn(&self) -> usize
Source§impl<A, B, C, D, E, F> GetSize for (A, B, C, D, E, F)
impl<A, B, C, D, E, F> GetSize for (A, B, C, D, E, F)
const USES_DYN_MEM: bool
fn size_bytes_dyn(&self) -> usize
fn size_bytes_content_dyn(&self) -> usize
Source§impl<A, B, C, D, E, F, G> GetSize for (A, B, C, D, E, F, G)
impl<A, B, C, D, E, F, G> GetSize for (A, B, C, D, E, F, G)
const USES_DYN_MEM: bool
fn size_bytes_dyn(&self) -> usize
fn size_bytes_content_dyn(&self) -> usize
Source§impl<A, B, C, D, E, F, G, H> GetSize for (A, B, C, D, E, F, G, H)
impl<A, B, C, D, E, F, G, H> GetSize for (A, B, C, D, E, F, G, H)
const USES_DYN_MEM: bool
fn size_bytes_dyn(&self) -> usize
fn size_bytes_content_dyn(&self) -> usize
Source§impl<A, B, C, D, E, F, G, H, I> GetSize for (A, B, C, D, E, F, G, H, I)
impl<A, B, C, D, E, F, G, H, I> GetSize for (A, B, C, D, E, F, G, H, I)
const USES_DYN_MEM: bool
fn size_bytes_dyn(&self) -> usize
fn size_bytes_content_dyn(&self) -> usize
Source§impl<A, B, C, D, E, F, G, H, I, J> GetSize for (A, B, C, D, E, F, G, H, I, J)
impl<A, B, C, D, E, F, G, H, I, J> GetSize for (A, B, C, D, E, F, G, H, I, J)
const USES_DYN_MEM: bool
fn size_bytes_dyn(&self) -> usize
fn size_bytes_content_dyn(&self) -> usize
Source§impl<BV> GetSize for RankSimple<BV>where
BV: GetSize,
impl<BV> GetSize for RankSimple<BV>where
BV: GetSize,
const USES_DYN_MEM: bool = true
fn size_bytes_dyn(&self) -> usize
Source§impl<D> GetSize for CombinedSampling<D>where
D: CombinedSamplingDensity,
<D as CombinedSamplingDensity>::SamplingDensity: GetSize,
impl<D> GetSize for CombinedSampling<D>where
D: CombinedSamplingDensity,
<D as CombinedSamplingDensity>::SamplingDensity: GetSize,
const USES_DYN_MEM: bool = true
fn size_bytes_dyn(&self) -> usize
Source§impl<S, S0, BV> GetSize for RankSelect101111<S, S0, BV>
impl<S, S0, BV> GetSize for RankSelect101111<S, S0, BV>
const USES_DYN_MEM: bool = true
fn size_bytes_dyn(&self) -> usize
Source§impl<T> GetSize for Box<[T]>where
T: GetSize,
impl<T> GetSize for Box<[T]>where
T: GetSize,
const USES_DYN_MEM: bool = true
fn size_bytes_dyn(&self) -> usize
Source§impl<T> GetSize for Box<T>where
T: GetSize,
impl<T> GetSize for Box<T>where
T: GetSize,
const USES_DYN_MEM: bool = true
fn size_bytes_dyn(&self) -> usize
Source§impl<T> GetSize for Rc<T>where
T: GetSize,
impl<T> GetSize for Rc<T>where
T: GetSize,
const USES_DYN_MEM: bool = true
fn size_bytes_dyn(&self) -> usize
Source§impl<T> GetSize for Vec<T>where
T: GetSize,
impl<T> GetSize for Vec<T>where
T: GetSize,
const USES_DYN_MEM: bool = true
fn size_bytes_dyn(&self) -> usize
fn size_bytes_content_dyn(&self) -> usize
Source§impl<T, const N: usize> GetSize for [T; N]where
T: GetSize,
impl<T, const N: usize> GetSize for [T; N]where
T: GetSize,
const USES_DYN_MEM: bool = T::USES_DYN_MEM
fn size_bytes_dyn(&self) -> usize
fn size_bytes_content_dyn(&self) -> usize
Implementors§
Source§impl GetSize for CompactFast
impl GetSize for CompactFast
const USES_DYN_MEM: bool = true
Source§impl GetSize for SuxEliasFano
Available on crate feature sux only.
impl GetSize for SuxEliasFano
sux only.