Skip to main content

RawPage

Struct RawPage 

Source
#[non_exhaustive]
pub struct RawPage { pub page_number: u32, pub page_flags: u32, pub previous_page: u32, pub next_page: u32, pub father_data_page: u32, pub object_id: u32, pub available_data_size: u16, pub available_page_tag: u16, pub bytes: Vec<u8>, }
Expand description

One page read out of the ESE database. Header parsed; page-body bytes retained so downstream (a future B-tree walker) can decode tags on demand.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§page_number: u32

1-indexed page number.

§page_flags: u32

Bitmask of page_flag flags.

§previous_page: u32

Page number of the previous sibling in the B-tree chain (0 = none).

§next_page: u32

Page number of the next sibling in the B-tree chain (0 = none).

§father_data_page: u32

Father Data Page (the parent B-tree node’s page number).

§object_id: u32

Object identifier this page belongs to (the FDP object ID).

§available_data_size: u16

Available data size (bytes free for new tags on this page).

§available_page_tag: u16

Number of tag entries on this page.

§bytes: Vec<u8>

The full page bytes (retained so B-tree/tag decoders can work on top).

Implementations§

Source§

impl RawPage

Source

pub fn parse( page_number: u32, bytes: &[u8], page_size: u32, ) -> Result<Self, Error>

Parse a page’s header. The layout differs between the “old” (pre-Vista, page-size- specific) and “new” (post-Vista, standard 40-byte header) formats. v0.1 supports the new format that Server 2008+ NTDS.dit uses.

New-format page header (40 bytes):

  0..8    XOR checksum (u32 pair) + ECC checksum
  8..12   page number (or 0 for pre-Vista format where number is implicit)
 12..20   modified time (u64)
 20..24   previous page
 24..28   next page
 28..32   father data page
 32..34   available data size
 34..36   available uncommitted data size
 36..38   available data offset
 38..40   available page tag
 40..44   page flags

object_id sits at 44..48 in the new format’s extended fields.

Source

pub fn has_flag(&self, flag: u32) -> bool

True if the page has all of the specified page_flag bits set.

Source

pub fn is_leaf(&self) -> bool

True if this is a leaf page (holds actual data records).

Source

pub fn is_root(&self) -> bool

True if this is a root page.

Trait Implementations§

Source§

impl Clone for RawPage

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RawPage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.