pub struct Sequence { /* private fields */ }Expand description
A symbolic sequence stored as raw bytes, plus a cached alphabet.
Implementations§
Source§impl Sequence
impl Sequence
pub fn new() -> Self
pub fn with_capacity(cap: usize) -> Self
pub fn from_str(s: &str) -> Self
pub fn from_bytes(b: Vec<u8>) -> Self
pub fn from_bytes_with_alphabet(b: Vec<u8>, alphabet_size: u32) -> Self
pub fn with_alphabet_size(alphabet_size: u32) -> Self
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
pub fn to_string_lossy(&self) -> String
pub fn alphabet(&self) -> &[u8] ⓘ
pub fn alphabet_size(&self) -> u32
pub fn set_alphabet_size(&mut self, s: u32)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn determine_alphabet(&mut self) -> Vec<u8> ⓘ
pub fn determine_alphabet(&mut self) -> Vec<u8> ⓘ
Scan the data and rebuild the alphabet (sorted descending), updating
alphabet_size if needed. Mirrors the C++ DetermineAlphabet().
pub fn push(&mut self, c: u8) -> usize
pub fn pop(&mut self) -> usize
pub fn clear(&mut self)
pub fn get(&self, idx: usize) -> Option<u8>
pub fn first(&self) -> Option<u8>
pub fn last(&self) -> Option<u8>
pub fn min_byte(&self) -> Option<u8>
pub fn max_byte(&self) -> Option<u8>
pub fn min_range(&self, start: usize, end: usize) -> Option<u8>
pub fn max_range(&self, start: usize, end: usize) -> Option<u8>
Sourcepub fn granularity(&self, gr: u32) -> Self
pub fn granularity(&self, gr: u32) -> Self
Mirror of seq.Granularity(gr).
pub fn reverse(&mut self) -> &mut Self
pub fn reverse_copy(&self) -> Self
pub fn pi(&mut self) -> &mut Self
pub fn right_shift(&mut self, ls: u32) -> &mut Self
pub fn left_shift(&mut self, ls: u32) -> &mut Self
Sourcepub fn char_density(&self) -> BTreeMap<u8, u32>
pub fn char_density(&self) -> BTreeMap<u8, u32>
Mirror of seq.charDensity().
Sourcepub fn map<F: Fn(u8) -> u8>(&self, f: F) -> Self
pub fn map<F: Fn(u8) -> u8>(&self, f: F) -> Self
Mirror of seq.map(f) — returns new sequence with f applied to each byte.
pub fn extend_from_slice(&mut self, other: &[u8])
Trait Implementations§
impl Eq for Sequence
Source§impl Ord for Sequence
impl Ord for Sequence
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Auto Trait Implementations§
impl Freeze for Sequence
impl RefUnwindSafe for Sequence
impl Send for Sequence
impl Sync for Sequence
impl Unpin for Sequence
impl UnsafeUnpin for Sequence
impl UnwindSafe for Sequence
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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