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

Method next

atomic-repository/src/history/iter.rs:74–111  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

72 type Item = HistoryResult<HistoryEntry>;
73
74 fn next(&mut self) -> Option<Self::Item> {
75 // Check limit
76 if let Some(limit) = self.limit {
77 if self.count >= limit {
78 return None;
79 }
80 }
81
82 // Get next from inner iterator
83 let result = self.inner.next()?;
84
85 self.count += 1;
86
87 match result {
88 Ok((seq, node_id, merkle)) => {
89 // Get the external hash
90 let hash = match self.txn.get_external(node_id) {
91 Ok(Some(h)) => h,
92 Ok(None) => {
93 return Some(Err(HistoryError::ChangeNotFound {
94 hash: format!("{:?}", node_id),
95 }));
96 }
97 Err(e) => {
98 return Some(Err(HistoryError::Database(e.to_string())));
99 }
100 };
101
102 let entry = HistoryEntry::new(seq, node_id, hash, merkle);
103
104 // Note: Header loading would be done by the Repository layer
105 // since it requires access to the ChangeStore
106
107 Some(Ok(entry))
108 }
109 Err(e) => Some(Err(HistoryError::Database(e.to_string()))),
110 }
111 }
112}
113
114// Log Functions

Callers 15

parse_versionFunction · 0.45
get_defaultMethod · 0.45
tokenize_single_fileFunction · 0.45
execute_planFunction · 0.45
kg_enrich_modulesMethod · 0.45
kg_enrich_filesMethod · 0.45
kg_enrich_changesMethod · 0.45
kg_enrich_changeMethod · 0.45
kg_enrich_includesMethod · 0.45
vault_auto_indexMethod · 0.45

Calls 1

get_externalMethod · 0.45

Tested by

no test coverage detected