Returns the logical number of items in this container.
(&self)
| 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 { |
no test coverage detected