1#![cfg_attr(not(feature = "std"), no_std)]
2
3extern crate alloc;
4
5mod constants;
6mod divsufsort;
7#[cfg(feature = "c-bench")]
8pub mod ffi;
9mod sssort;
10mod trsort;
11mod utils;
12
13pub use divsufsort::{divbwt, divsufsort};
14pub use utils::{
15 SufCheckError, bw_transform, inverse_bw_transform, sa_search, sa_simplesearch, sufcheck,
16};
17
18#[derive(Debug, PartialEq, Eq)]
20pub enum DivSufSortError {
21 InvalidArgument,
23 AllocationFailure,
25}
26
27impl core::fmt::Display for DivSufSortError {
28 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
29 match self {
30 Self::InvalidArgument => write!(f, "invalid argument"),
31 Self::AllocationFailure => write!(f, "allocation failure"),
32 }
33 }
34}
35
36#[cfg(feature = "std")]
37impl std::error::Error for DivSufSortError {}