MCPcopy Create free account
hub / github.com/Lokathor/tinyvec / capacity

Method capacity

src/arrayvec.rs:392–397  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

390 #[inline(always)]
391 #[must_use]
392 pub fn capacity(&self) -> usize {
393 // Note: This shouldn't use A::CAPACITY, because unsafe code can't rely on
394 // any Array invariants. This ensures that at the very least, the returned
395 // value is a valid length for a subslice of the backing array.
396 self.data.as_slice().len().min(u16::MAX as usize)
397 }
398
399 /// Truncates the `ArrayVec` down to length 0.
400 #[inline(always)]

Callers 8

deserialize_readerMethod · 0.45
fillMethod · 0.45
is_fullMethod · 0.45
visit_seqMethod · 0.45
reserveMethod · 0.45
try_reserveMethod · 0.45
reserve_exactMethod · 0.45
try_reserve_exactMethod · 0.45

Calls 2

lenMethod · 0.45
as_sliceMethod · 0.45

Tested by

no test coverage detected