pub struct Cell {
pub rowid: i64,
pub values: Vec<Option<Value>>,
}Expand description
A decoded cell: one row’s worth of values plus its rowid.
values is indexed by declared column position. None means the column
was NULL in this cell.
Fields§
§rowid: i64§values: Vec<Option<Value>>Implementations§
Source§impl Cell
impl Cell
pub fn new(rowid: i64, values: Vec<Option<Value>>) -> Self
Sourcepub fn encode(&self) -> Result<Vec<u8>>
pub fn encode(&self) -> Result<Vec<u8>>
Serializes the cell into freshly allocated bytes. The encoding starts
with the shared [cell_length | kind_tag] prefix so readers can
dispatch to the right decoder; kind_tag is always KIND_LOCAL
for this type.
Sourcepub fn encoded_len(&self) -> Result<usize>
pub fn encoded_len(&self) -> Result<usize>
Returns the byte length of the encoded form. Convenient for fit-in-page calculations without actually encoding.
Sourcepub fn peek_rowid(buf: &[u8], pos: usize) -> Result<i64>
pub fn peek_rowid(buf: &[u8], pos: usize) -> Result<i64>
Reads the rowid out of an encoded entry (either a local cell or an overflow pointer), skipping the rest. Used by binary search on a page’s slot directory — both kinds have rowid at the same position relative to the kind tag.
Sourcepub fn encoded_size_at(buf: &[u8], pos: usize) -> Result<usize>
pub fn encoded_size_at(buf: &[u8], pos: usize) -> Result<usize>
Returns the total encoded length (including the cell_length prefix)
of the cell-or-overflow-ref that starts at buf[pos]. Does not
fully decode the body.