pub struct SqliteReader {
pub header: SqliteHeader,
/* private fields */
}Expand description
Minimal SQLite binary file parser providing header access and page slicing.
Fields§
§header: SqliteHeaderParsed file header.
Implementations§
Source§impl SqliteReader
impl SqliteReader
Sourcepub fn from_bytes(data: Vec<u8>) -> Result<Self, GpkgError>
pub fn from_bytes(data: Vec<u8>) -> Result<Self, GpkgError>
Parse a SQLite file from its raw bytes.
§Errors
Returns GpkgError::InvalidFormat when the data is too short or does
not begin with the SQLite magic string.
Sourcepub fn page(&self, page_num: u32) -> Result<&[u8], GpkgError>
pub fn page(&self, page_num: u32) -> Result<&[u8], GpkgError>
Return the byte slice for the given page (1-indexed, as per SQLite spec).
§Errors
Returns GpkgError::InvalidFormat if page_num is 0 or out of range.
Sourcepub fn page_count(&self) -> u32
pub fn page_count(&self) -> u32
Return the number of pages, preferring the header value when non-zero.
Auto Trait Implementations§
impl Freeze for SqliteReader
impl RefUnwindSafe for SqliteReader
impl Send for SqliteReader
impl Sync for SqliteReader
impl Unpin for SqliteReader
impl UnsafeUnpin for SqliteReader
impl UnwindSafe for SqliteReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more