diff options
-rw-r--r-- | src/lib.rs | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -115,6 +115,18 @@ where unsafe { field_ptr.cast().as_ref() } } + /// Returns the number of items stored in this `MultiVec`. + pub fn len(&self) -> usize + { + self.length + } + + /// Returns how many items this `MultiVec` has capacity for. + pub fn capacity(&self) -> usize + { + self.capacity + } + fn grow_amortized(&mut self, additional: usize) { let required_cap = self.capacity.checked_add(additional).unwrap(); |