MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / tail_stream

Method tail_stream

crates/core/src/database_logger.rs:100–116  ·  view source on GitHub ↗
(&self, n: Option<u32>)

Source from the content-addressed store, hash-verified

98 }
99
100 fn tail_stream(&self, n: Option<u32>) -> LogStream {
101 stream::once(asyncify({
102 let path = self.path.clone();
103 move || {
104 let mut file = File::open(path)?;
105 if let Some(n) = n {
106 let mut buf = seek_buffer(n);
107 seek_to(&mut file, &mut buf, n)?;
108 }
109
110 Ok::<_, io::Error>(tokio::fs::File::from_std(file))
111 }
112 }))
113 .map_ok(ReaderStream::new)
114 .try_flatten()
115 .boxed()
116 }
117
118 fn sync_data(&self) -> io::Result<()> {
119 self.file.sync_data()

Callers 1

tailMethod · 0.80

Calls 10

seek_bufferFunction · 0.85
seek_toFunction · 0.85
unwrap_orMethod · 0.80
asyncifyFunction · 0.50
openFunction · 0.50
iterFunction · 0.50
cloneMethod · 0.45
lenMethod · 0.45
mapMethod · 0.45
rangeMethod · 0.45

Tested by

no test coverage detected