Struct SuffixArray

Source
pub struct SuffixArray<'a, Index>
where Index: ToPrimitive,
{ /* private fields */ }
Expand description

A suffix array

Implementations§

Source§

impl<'a, Index> SuffixArray<'a, Index>
where Index: ToPrimitive,

Source

pub fn new(text: &'a [u8], sa: Vec<Index>) -> Self

Create an instance of SuffixArray, taking ownership of sa

Source

pub fn into_parts(self) -> (&'a [u8], Vec<Index>)

Return (text, sa), giving back ownership of sa

Source

pub fn verify(&self) -> Result<(), NotSorted>

Verifies that this suffix array is sorted.

Source

pub fn text(&self) -> &[u8]

Returns a reference to the text

Trait Implementations§

Source§

impl<'a, Index> StringIndex<'a> for SuffixArray<'a, Index>
where Index: ToPrimitive,

Source§

fn longest_substring_match(&self, needle: &[u8]) -> LongestCommonSubstring<'a>

Returns the longest substring that matches needle in text

Auto Trait Implementations§

§

impl<'a, Index> Freeze for SuffixArray<'a, Index>

§

impl<'a, Index> RefUnwindSafe for SuffixArray<'a, Index>
where Index: RefUnwindSafe,

§

impl<'a, Index> Send for SuffixArray<'a, Index>
where Index: Send,

§

impl<'a, Index> Sync for SuffixArray<'a, Index>
where Index: Sync,

§

impl<'a, Index> Unpin for SuffixArray<'a, Index>
where Index: Unpin,

§

impl<'a, Index> UnwindSafe for SuffixArray<'a, Index>
where Index: UnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.