pub struct MemoFile { /* private fields */ }Expand description
Reader for a .dbt memo file paired with a .dbf table.
The reader owns its file handle and offers random-access reads of memo blocks by index. Block 0 is the header and is never returned as a payload.
Implementations§
Source§impl MemoFile
impl MemoFile
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self, MemoError>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, MemoError>
Opens a .dbt memo file and parses its header block.
Returns MemoError::UnsupportedVersion for dBase III (0x00) and
any other unknown version byte. Only dBase IV (0x03) is supported.
Sourcepub fn set_encoding(&mut self, encoding: &'static Encoding)
pub fn set_encoding(&mut self, encoding: &'static Encoding)
Overrides the encoding used to transcode memo payloads.
Sourcepub fn block_size(&self) -> u32
pub fn block_size(&self) -> u32
Returns the block size declared in the header (default 512).
Sourcepub fn version(&self) -> MemoVersion
pub fn version(&self) -> MemoVersion
Returns the detected memo file dialect.
Sourcepub fn next_block(&self) -> u32
pub fn next_block(&self) -> u32
Returns the next-free block index, which is also one past the last valid block.
Sourcepub fn read_block(&mut self, index: u32) -> Result<String, MemoError>
pub fn read_block(&mut self, index: u32) -> Result<String, MemoError>
Reads the memo payload stored in block index.
Returns MemoError::BlockIndexOutOfRange when index >= next_block.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MemoFile
impl RefUnwindSafe for MemoFile
impl Send for MemoFile
impl Sync for MemoFile
impl Unpin for MemoFile
impl UnsafeUnpin for MemoFile
impl UnwindSafe for MemoFile
Blanket Implementations§
impl<T> Allocation for T
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