pub struct MmapSequenceStore { /* private fields */ }Expand description
A sequence store backed by memory-mapped FASTA files.
Only the digest index and metadata are held in RAM. Sequence bytes are read from the memory-mapped file on each request, with the OS managing page caching.
Requires a .refget.json digest cache for each FASTA file. Use
refget-tools cache to generate them.
Implementations§
Source§impl MmapSequenceStore
impl MmapSequenceStore
Sourcepub fn mark_circular(&mut self, circular_names: &[String])
pub fn mark_circular(&mut self, circular_names: &[String])
Mark sequences with matching names as circular.
Sourcepub fn add_fasta<P: AsRef<Path>>(
&mut self,
path: P,
) -> StoreResult<Vec<FastaSequenceSummary>>
pub fn add_fasta<P: AsRef<Path>>( &mut self, path: P, ) -> StoreResult<Vec<FastaSequenceSummary>>
Add a FASTA file to the store via memory mapping.
Requires a fresh .refget.json digest cache. Returns an error if
the cache is missing or stale.
Trait Implementations§
Source§impl Default for MmapSequenceStore
impl Default for MmapSequenceStore
Source§impl SequenceStore for MmapSequenceStore
impl SequenceStore for MmapSequenceStore
Source§fn get_sequence(
&self,
digest: &str,
start: Option<u64>,
end: Option<u64>,
) -> StoreResult<Option<Vec<u8>>>
fn get_sequence( &self, digest: &str, start: Option<u64>, end: Option<u64>, ) -> StoreResult<Option<Vec<u8>>>
Retrieve sequence bases by digest (MD5 or sha512t24u).
Supports optional start/end for subsequence retrieval (0-based, half-open).
Source§fn get_metadata(&self, digest: &str) -> StoreResult<Option<SequenceMetadata>>
fn get_metadata(&self, digest: &str) -> StoreResult<Option<SequenceMetadata>>
Retrieve metadata for a sequence by digest.
Source§fn get_length(&self, digest: &str) -> StoreResult<Option<u64>>
fn get_length(&self, digest: &str) -> StoreResult<Option<u64>>
Retrieve the length of a sequence by digest.
Auto Trait Implementations§
impl Freeze for MmapSequenceStore
impl RefUnwindSafe for MmapSequenceStore
impl Send for MmapSequenceStore
impl Sync for MmapSequenceStore
impl Unpin for MmapSequenceStore
impl UnsafeUnpin for MmapSequenceStore
impl UnwindSafe for MmapSequenceStore
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