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

Method read_file_state

atomic-core/src/operation/codec.rs:1456–1473  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

1454 }
1455
1456 fn read_file_state(&mut self) -> Result<FileState, OperationCodecError> {
1457 let kind = match self.read_u8()? {
1458 0 => FileKind::Regular,
1459 1 => FileKind::Directory,
1460 2 => FileKind::Symlink,
1461 3 => FileKind::Gitlink,
1462 tag => {
1463 return Err(OperationCodecError::new(format!(
1464 "unsupported file kind tag {tag}"
1465 )))
1466 }
1467 };
1468 Ok(FileState {
1469 kind,
1470 mode: self.read_u32()?,
1471 content: self.read_hash()?,
1472 })
1473 }
1474
1475 fn read_receipt_kind(&mut self) -> Result<EffectReceiptKind, OperationCodecError> {
1476 match self.read_u8()? {

Callers 1

read_effect_valueMethod · 0.80

Calls 3

read_u8Method · 0.80
read_u32Method · 0.80
read_hashMethod · 0.80

Tested by

no test coverage detected