pub struct CatalogEntry {
pub object_type: u16,
pub object_id: u32,
pub parent_object_id: u32,
pub table_page: u32,
pub object_name: String,
}Expand description
One entry from the ESE catalog.
Fields§
§object_type: u16Object type: 1 = table, 2 = column, etc.
object_id: u32Object ID.
parent_object_id: u32Parent object ID.
table_page: u32Root page number for this table’s B-tree.
object_name: StringObject name (table name, column name, etc.).
Implementations§
Source§impl CatalogEntry
impl CatalogEntry
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self, EseError>
pub fn from_bytes(data: &[u8]) -> Result<Self, EseError>
Parse one catalog record from a byte slice.
§Errors
Returns EseError::Corrupt if the slice is too short or
the name bytes are not valid UTF-8.
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Serialize this entry to bytes (for building test fixtures).
Sourcepub fn scan_catalog_page_data(data_area: &[u8]) -> Vec<Self>
pub fn scan_catalog_page_data(data_area: &[u8]) -> Vec<Self>
Scan the raw data area of an ESE catalog leaf page for all TABLE entries.
Unlike [parse_real_catalog_record], which scans a single tag’s bytes
and returns the first match, this function scans the entire page data
area (from the end of the 40-byte header to the start of the tag array)
and returns every distinct entry found.
Real ESE catalog leaf pages use a cumulative key-prefix-compression format where the first logical records can reside in the page data area before the offset of the first tag. Scanning individual tags therefore misses those early records. This function avoids that problem by scanning the full data span directly.
Entries are deduplicated by object_name — if the same name appears
more than once (because the cumulative format causes successive tags to
re-include earlier data), only the first occurrence is kept.
Sourcepub fn parse_real_catalog_record(data: &[u8]) -> Option<Self>
pub fn parse_real_catalog_record(data: &[u8]) -> Option<Self>
Try to parse a real ESE catalog TABLE entry from a leaf-page tag byte slice.
Real ESE MSysObjects records use a tagged-column encoding where the Name
column (column 128) is preceded by a two-byte marker [0xFF, 0x00] followed
by a two-byte LE length and the ASCII name bytes. The pgnoFDP (root B-tree
page of the table) lives 16 bytes before the 0xFF marker, and the object ID
lives 20 bytes before it — both as u32 LE.
pgnoFDP is stored as an ESE 0-based data-page number; this function adds 1
to convert it to the physical page number expected by [EseDatabase::read_page].
Returns None if the slice contains no recognisable TABLE entry.
Trait Implementations§
Source§impl Clone for CatalogEntry
impl Clone for CatalogEntry
Source§fn clone(&self) -> CatalogEntry
fn clone(&self) -> CatalogEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more