MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / next

Method next

crates/hyperqueue/src/server/event/journal/read.rs:72–92  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

70 type Item = Result<Event, anyhow::Error>;
71
72 fn next(&mut self) -> Option<Self::Item> {
73 self.position = self.source.stream_position().unwrap();
74 if self.position >= self.size {
75 return None;
76 }
77 match EventSerializationConfig::config().deserialize_from(&mut self.source) {
78 Ok(event) => Some(Ok(event)),
79 Err(error) => match error.deref() {
80 bincode::ErrorKind::Io(e)
81 if matches!(e.kind(), std::io::ErrorKind::UnexpectedEof) =>
82 {
83 self.partial_data_error = true;
84 None
85 }
86 _ => Some(Err(anyhow!(
87 "Load journal event failed at position: {}. Deserialization error: {error:?}",
88 self.position
89 ))),
90 },
91 }
92 }
93}
94
95#[cfg(test)]

Callers 15

newMethod · 0.45
client_rpc_loopFunction · 0.45
roundtrip_exhaust_bufferFunction · 0.45
streaming_read_partialFunction · 0.45
command_worker_addressFunction · 0.45
receiveMethod · 0.45
iter_priority_sizesMethod · 0.45
drain_prefillFunction · 0.45
create_task_batchesFunction · 0.45
worker_hostnameMethod · 0.45

Calls 1

derefMethod · 0.45

Tested by 6

roundtrip_exhaust_bufferFunction · 0.36
streaming_read_partialFunction · 0.36
test_prefill_stealFunction · 0.36
test_steal_runningFunction · 0.36
test_steal_failedFunction · 0.36