MCPcopy Create free account
hub / github.com/apache/paimon-rust / encode_to_buf

Method encode_to_buf

crates/paimon/src/btree/block.rs:180–186  ·  view source on GitHub ↗

Encode into a stack buffer, returning (buffer, length).

(&self)

Source from the content-addressed store, hash-verified

178
179 /// Encode into a stack buffer, returning (buffer, length).
180 pub fn encode_to_buf(&self) -> ([u8; BLOCK_HANDLE_MAX_ENCODED_LENGTH], usize) {
181 let mut buf = [0u8; BLOCK_HANDLE_MAX_ENCODED_LENGTH];
182 let mut cursor = io::Cursor::new(&mut buf[..]);
183 self.write_to(&mut cursor).unwrap();
184 let len = cursor.position() as usize;
185 (buf, len)
186 }
187
188 pub fn decode(data: &[u8]) -> io::Result<Self> {
189 Self::read_from(&mut Cursor::new(data))

Callers 1

flushMethod · 0.80

Calls 2

write_toMethod · 0.80
positionMethod · 0.45

Tested by

no test coverage detected