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

Method to_bytes

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

Encode trailer to a fixed-size stack array.

(&self)

Source from the content-addressed store, hash-verified

106
107 /// Encode trailer to a fixed-size stack array.
108 pub fn to_bytes(&self) -> [u8; BLOCK_TRAILER_LENGTH] {
109 let crc_bytes = (self.crc32c as i32).to_le_bytes();
110 [
111 self.compression_type as u8,
112 crc_bytes[0],
113 crc_bytes[1],
114 crc_bytes[2],
115 crc_bytes[3],
116 ]
117 }
118
119 pub fn read_from(data: &[u8]) -> io::Result<Self> {
120 if data.len() < BLOCK_TRAILER_LENGTH {

Callers 3

readMethod · 0.80
write_block_dataMethod · 0.80
write_index_blockMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected