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

Function read_exact

crates/commitlog/src/stream/common.rs:156–164  ·  view source on GitHub ↗
(src: &mut (impl AsyncRead + Unpin), buf: &mut [u8])

Source from the content-addressed store, hash-verified

154}
155
156pub(super) async fn read_exact(src: &mut (impl AsyncRead + Unpin), buf: &mut [u8]) -> io::Result<DidReadExact> {
157 src.read_exact(buf).await.map(|_| DidReadExact::All).or_else(|e| {
158 if e.kind() == io::ErrorKind::UnexpectedEof {
159 Ok(DidReadExact::Eof)
160 } else {
161 Err(e)
162 }
163 })
164}
165
166/// Get a reference to the [`AsyncBufRead`]'s buffer, filling it if necessary.
167pub(super) async fn peek_buf(src: &mut (impl AsyncBufRead + Unpin)) -> io::Result<Option<&[u8]>> {

Callers 1

append_all_innerMethod · 0.85

Calls 4

OkFunction · 0.50
ErrFunction · 0.50
mapMethod · 0.45
kindMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…