feophantlib/engine/io/row_formats/info_mask.rs
1//! Bit flags for things such as nullable.
2//! See here: https://doxygen.postgresql.org/htup__details_8h_source.html
3
4use std::mem::size_of;
5
6use crate::engine::io::ConstEncodedSize;
7
8bitflags! {
9 pub struct InfoMask: u8 {
10 const HAS_NULL = 0b00000001;
11 }
12}
13
14impl ConstEncodedSize for InfoMask {
15 fn encoded_size() -> usize {
16 size_of::<u8>()
17 }
18}
19
20#[cfg(test)]
21mod tests {
22 use super::*;
23
24 #[test]
25 fn test_encoded_size() {
26 assert_eq!(1, InfoMask::encoded_size())
27 }
28}