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

Method get_slice

crates/sats/src/buffer.rs:174–180  ·  view source on GitHub ↗
(&mut self, size: usize)

Source from the content-addressed store, hash-verified

172 /// Reads and returns a byte slice of `.len() = size` advancing the cursor.
173 #[inline]
174 fn get_slice(&mut self, size: usize) -> Result<&'de [u8], DecodeError> {
175 self.get_chunk(size).ok_or_else(|| DecodeError::BufferLength {
176 for_type: "[u8]",
177 expected: size,
178 given: self.remaining(),
179 })
180 }
181
182 /// Reads an array of type `[u8; N]` from the input.
183 #[inline]

Callers 1

Implementers 1

buffer.rscrates/sats/src/buffer.rs

Calls 2

get_chunkMethod · 0.80
remainingMethod · 0.45

Tested by 1