MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / item_count

Method item_count

src/buffer.rs:217–219  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

215 /// Gets the total number of items.
216 #[inline]
217 pub fn item_count(&self) -> usize {
218 (self.0.len as usize) / (self.0.itemsize as usize)
219 }
220
221 /// `item_size() * item_count()`.
222 /// For contiguous arrays, this is the length of the underlying memory block.

Callers 5

as_sliceMethod · 0.80
as_mut_sliceMethod · 0.80
as_fortran_sliceMethod · 0.80
as_fortran_mut_sliceMethod · 0.80
to_vec_implMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected