pub struct SpoolReader { /* private fields */ }Expand description
Reads cards from a spool file
Implementations§
Source§impl SpoolReader
impl SpoolReader
Sourcepub fn open_embedded<P: AsRef<Path>>(path: P, base_offset: u64) -> Result<Self>
pub fn open_embedded<P: AsRef<Path>>(path: P, base_offset: u64) -> Result<Self>
Open a spool embedded within a larger file at a given byte offset.
Reads the SP01 header starting at base_offset, then adjusts all
internal offsets so that read_card() seeks to the correct position
within the host file. This enables direct access to spool data
stitched into an Engram archive without temp extraction.
Sourcepub fn card_count(&self) -> usize
pub fn card_count(&self) -> usize
Get number of cards in spool
Sourcepub fn read_card_at(&mut self, offset: u64, length: usize) -> Result<Vec<u8>>
pub fn read_card_at(&mut self, offset: u64, length: usize) -> Result<Vec<u8>>
Read a card at specific offset and length
Sourcepub fn get_entry(&self, index: usize) -> Option<&SpoolEntry>
pub fn get_entry(&self, index: usize) -> Option<&SpoolEntry>
Get entry for a card index
Sourcepub fn entries(&self) -> &[SpoolEntry]
pub fn entries(&self) -> &[SpoolEntry]
Get all entries
Auto Trait Implementations§
impl Freeze for SpoolReader
impl RefUnwindSafe for SpoolReader
impl Send for SpoolReader
impl Sync for SpoolReader
impl Unpin for SpoolReader
impl UnsafeUnpin for SpoolReader
impl UnwindSafe for SpoolReader
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