MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / read_count

Method read_count

atomic-core/src/operation/codec.rs:915–923  ·  view source on GitHub ↗
(&mut self, field: &str)

Source from the content-addressed store, hash-verified

913 }
914
915 fn read_count(&mut self, field: &str) -> Result<usize, OperationCodecError> {
916 let count = self.read_u32()? as usize;
917 if count > MAX_OPERATION_COLLECTION_ITEMS {
918 return Err(OperationCodecError::new(format!(
919 "{field} has {count} items, maximum is {MAX_OPERATION_COLLECTION_ITEMS}"
920 )));
921 }
922 Ok(count)
923 }
924
925 fn read_string(&mut self, field: &str) -> Result<String, OperationCodecError> {
926 let len = self.read_u32()? as usize;

Calls 1

read_u32Method · 0.80