MCPcopy Create free account
hub / github.com/RetypeOS/parcode / len

Method len

src/reader.rs:1066–1074  ·  view source on GitHub ↗

Returns the logical number of items in this container.

(&self)

Source from the content-addressed store, hash-verified

1064
1065 /// Returns the logical number of items in this container.
1066 pub fn len(&self) -> u64 {
1067 if let Ok(payload) = self.read_raw()
1068 && payload.len() >= 8
1069 && let Some(bytes) = payload.get(0..8).and_then(|s| s.try_into().ok())
1070 {
1071 return u64::from_le_bytes(bytes);
1072 }
1073 0
1074 }
1075
1076 /// Checks if the container is empty.
1077 pub fn is_empty(&self) -> bool {

Callers 9

read_into_sliceMethod · 0.45
from_nodeMethod · 0.45
openMethod · 0.45
from_bytesMethod · 0.45
is_emptyMethod · 0.45
locate_shard_itemMethod · 0.45
getMethod · 0.45
iterMethod · 0.45

Calls 2

read_rawMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected