pub struct Engine { /* private fields */ }Expand description
The streaming counter.
Implementations§
Source§impl Engine
impl Engine
Sourcepub fn new(
width: usize,
k: usize,
strata: usize,
threads: usize,
) -> Result<Self>
pub fn new( width: usize, k: usize, strata: usize, threads: usize, ) -> Result<Self>
A counter for alignments of width columns, k-mers of length k, strata stratified
header fields, split into shards for threads workers.
§Errors
A usage error when k is 0 or longer than the alignment.
Sourcepub fn shard_count(&self) -> usize
pub fn shard_count(&self) -> usize
Number of shards (exposed for diagnostics and tests).
Sourcepub fn add_batch(
&mut self,
rows: &[u8],
records: usize,
values: &[u32],
cancel: &AtomicBool,
) -> Result<()>
pub fn add_batch( &mut self, rows: &[u8], records: usize, values: &[u32], cancel: &AtomicBool, ) -> Result<()>
Counts a batch: rows holds records × width canonical bytes (0 = excluded column);
values holds records × strata header value ids (empty without metadata). Runs on the
current rayon pool.
§Errors
Sourcepub fn finish(self) -> Vec<PositionCounts>
pub fn finish(self) -> Vec<PositionCounts>
Finishes counting and returns the counts of every position, in position order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Engine
impl RefUnwindSafe for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl UnsafeUnpin for Engine
impl UnwindSafe for Engine
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more