Skip to content

Commit

Permalink
Add len/capacity to TimelyStack
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Hoffmann <[email protected]>
  • Loading branch information
antiguru committed Feb 5, 2024
1 parent bb94b15 commit 4801f8d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions container/src/columnation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,18 @@ impl<T: Columnation> TimelyStack<T> {
});
(length, capacity)
}

/// The length in items.
#[inline]
pub fn len(&self) -> usize {
self.local.len()
}

/// The capacity of the local vector.
#[inline]
pub fn capacity(&self) -> usize {
self.local.capacity()
}
}

impl<A: Columnation, B: Columnation> TimelyStack<(A, B)> {
Expand Down

0 comments on commit 4801f8d

Please sign in to comment.