Skip to main content

FastaImportOptions

Struct FastaImportOptions 

Source
pub struct FastaImportOptions<'a> { /* private fields */ }
Expand description

Options for importing a FASTA file into a RefgetStore.

§Single-knob parallelism model

jobs is the number of input FASTA files imported concurrently. 0 = auto (std::thread::available_parallelism). 1 = serial. It has no effect with a single input file (each file is processed by the basic read->digest->encode pipeline either way).

§Two independent alias indexes

A store keeps two separate alias indexes, and these options feed exactly one each:

  • namespaces feeds only the sequence alias index. It is a parsing directive: it lists which ns:value tokens to harvest out of each FASTA header and register per sequence.
  • collection_alias feeds only the collection alias index. It is an assertion by the caller naming the collection as a whole, because a FASTA says what each sequence is called but never what the assembly is called.

They are deliberately decoupled: setting namespaces never names the collection, and setting collection_alias never registers a sequence alias.

Implementations§

Source§

impl<'a> FastaImportOptions<'a>

Source

pub fn new() -> Self

Source

pub fn force(self, yes: bool) -> Self

Source

pub fn namespaces(self, ns: &'a [&'a str]) -> Self

Source

pub fn jobs(self, n: usize) -> Self

Set the number of input FASTA files imported concurrently. 0 (the default) means auto via std::thread::available_parallelism; 1 means serial. No effect with a single input file.

Source

pub fn collection_alias(self, namespace: &'a str, alias: &'a str) -> Self

Register the imported collection in the collection alias index under namespace:alias (e.g. .collection_alias("ucsc", "hg38")).

This is an explicit assertion by the caller — nothing in a FASTA file names the assembly. It is independent of Self::namespaces, which only harvests per-sequence aliases from headers.

Only valid when importing a single FASTA file; importing multiple files with this set returns an error, because one alias cannot name N collections. For the multi-file case, import without this option and call add_collection_alias per returned collection (results come back in input order).

If the alias already resolves to a different collection digest, the import errors rather than silently remapping it, unless Self::force is set. Re-registering the same digest is a no-op.

Source

pub fn standalone_file_limit(self, limit: usize) -> Self

Set the pre-flight ceiling on .seq file count for STANDALONE imports. Packed stores bypass this gate; force does not. 0 is not special: to lift the limit, pass a large number.

Trait Implementations§

Source§

impl<'a> Clone for FastaImportOptions<'a>

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<'a> Copy for FastaImportOptions<'a>

Source§

impl<'a> Default for FastaImportOptions<'a>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Forget for FastaImportOptions<'a>

§

impl<'a> Freeze for FastaImportOptions<'a>

§

impl<'a> Move for FastaImportOptions<'a>

§

impl<'a> RefUnwindSafe for FastaImportOptions<'a>

§

impl<'a> Send for FastaImportOptions<'a>

§

impl<'a> Sync for FastaImportOptions<'a>

§

impl<'a> Unpin for FastaImportOptions<'a>

§

impl<'a> UnsafeUnpin for FastaImportOptions<'a>

§

impl<'a> UnwindSafe for FastaImportOptions<'a>

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> Same for T

Source§

type Output = T

Should always be Self
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.