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

Function read_receipt

atomic-cli/src/commands/diagnostics/collect.rs:889–900  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

887}
888
889fn read_receipt(path: &Path) -> ReceiptLookup {
890 match std::fs::read_to_string(path) {
891 Ok(text) => match serde_json::from_str::<Receipt>(&text) {
892 Ok(receipt) => ReceiptLookup::Found(receipt),
893 Err(error) => ReceiptLookup::Unreadable(ReceiptError::Parse(error.classify())),
894 },
895 Err(error) if error.kind() == ErrorKind::NotFound && demonstrably_missing(path) => {
896 ReceiptLookup::Absent
897 }
898 Err(error) => ReceiptLookup::Unreadable(ReceiptError::Read(error.kind())),
899 }
900}
901
902/// Agent directories under the integrations root that hold a receipt.
903fn receipts_on_disk(root: &Path) -> Vec<String> {

Callers 1

collect_fromFunction · 0.85

Calls 3

demonstrably_missingFunction · 0.85
classifyMethod · 0.80
kindMethod · 0.45

Tested by

no test coverage detected