pub struct RecordPiece {
pub record: Arc<Record>,
pub start: Position,
pub end: Position,
}Expand description
One Record will be split into multiple RecordPieces. The original Record is kept as an Arc so that each of the RecordPieces can share the same ownership. Arc rather than Rc because the pieces are scored in parallel, and Rc is not Send.
Fields§
§record: Arc<Record>§start: Position§end: PositionImplementations§
Source§impl RecordPiece
impl RecordPiece
Sourcepub fn sequence(&self) -> Sequence
pub fn sequence(&self) -> Sequence
Get the sequence of the RecordPiece by slicing into the original Record.
This copies the slice out. Prefer RecordPiece::bases when the bytes are only
going to be read, which is the case on the scoring path.
Sourcepub fn bases(&self) -> &[u8] ⓘ
pub fn bases(&self) -> &[u8] ⓘ
Borrow this piece’s bases directly out of the shared Record.
Unlike RecordPiece::sequence this allocates nothing, so scoring a piece does
not begin by copying it. start and end are 1-based and inclusive.
Auto Trait Implementations§
impl Freeze for RecordPiece
impl RefUnwindSafe for RecordPiece
impl Send for RecordPiece
impl Sync for RecordPiece
impl Unpin for RecordPiece
impl UnsafeUnpin for RecordPiece
impl UnwindSafe for RecordPiece
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
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