[−][src]Struct suffix_array::SuffixArray
Suffix array for searching byte strings.
Methods
impl<'s> SuffixArray<'s>
[src]
pub fn new(s: &'s [u8]) -> Self
[src]
pub fn set(&mut self, s: &'s [u8])
[src]
pub fn fit(&mut self)
[src]
pub fn len(&self) -> usize
[src]
Length of the underlying byte string.
pub fn is_empty(&self) -> bool
[src]
Test if the underlying byte string is empty.
pub fn into_parts(self) -> (&'s [u8], Vec<u32>)
[src]
Take out the suffix array and its corresponding byte string.
pub fn from_parts(s: &'s [u8], sa: Vec<u32>) -> Option<Self>
[src]
Compose existed suffix array and its corresponding byte string together, and checks the integrity.
pub unsafe fn unchecked_from_parts(s: &'s [u8], sa: Vec<u32>) -> Self
[src]
Compose existed suffix array and its corresponding byte string together without integrity check.
pub fn contains(&self, sub: &[u8]) -> bool
[src]
Test if contains given sub-string.
pub fn search_all(&self, sub: &[u8]) -> &[u32]
[src]
Search for all the unsorted overlapping occurrence of given sub-string.
pub fn search_lcp(&self, pat: &[u8]) -> Range<usize>
[src]
Search for one sub-string that has the longest common prefix of the given pattern.
pub fn dump<W: Write>(&self, file: W) -> Result<()>
[src]
Write the suffix array (without the byte string).
pub fn dump_file<P: AsRef<Path>>(&self, name: P) -> Result<()>
[src]
Create a file and write the suffix array (without the byte string).
pub fn dump_bytes(&self) -> Result<Vec<u8>>
[src]
Dump the suffix array as bytes (without the byte string).
pub unsafe fn unchecked_load<R: Read>(s: &'s [u8], file: R) -> Result<Self>
[src]
Read suffix array without integrity check.
pub fn load<R: Read>(s: &'s [u8], file: R) -> Result<Self>
[src]
Read suffix array.
pub unsafe fn unchecked_load_file<P: AsRef<Path>>(
s: &'s [u8],
name: P
) -> Result<Self>
[src]
s: &'s [u8],
name: P
) -> Result<Self>
Read suffix array from a file without integrity check.
pub fn load_file<P: AsRef<Path>>(s: &'s [u8], name: P) -> Result<Self>
[src]
Read suffix array from a file.
pub unsafe fn unchecked_load_bytes(s: &'s [u8], bytes: &[u8]) -> Result<Self>
[src]
Load suffix array from bytes without integrity check.
pub fn load_bytes(s: &'s [u8], bytes: &[u8]) -> Result<Self>
[src]
Load suffix array from bytes.
Trait Implementations
impl<'s> AsRef<[u8]> for SuffixArray<'s>
[src]
impl<'s> Clone for SuffixArray<'s>
[src]
fn clone(&self) -> SuffixArray<'s>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'s> From<SuffixArray<'s>> for Vec<u32>
[src]
fn from(sa: SuffixArray<'s>) -> Vec<u32>
[src]
Auto Trait Implementations
impl<'s> Sync for SuffixArray<'s>
impl<'s> Send for SuffixArray<'s>
impl<'s> Unpin for SuffixArray<'s>
impl<'s> RefUnwindSafe for SuffixArray<'s>
impl<'s> UnwindSafe for SuffixArray<'s>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,