pub struct SearchEngine;Expand description
Full-text search engine across chapter sections.
Implementations§
Source§impl SearchEngine
impl SearchEngine
Sourcepub fn search(
sections: &[Section],
query: &str,
case_sensitive: bool,
) -> Vec<SearchResult>
pub fn search( sections: &[Section], query: &str, case_sensitive: bool, ) -> Vec<SearchResult>
Perform full-text search over a slice of sections. Uses SIMD memmem search over pre-lowered section text for high-throughput, allocation-light scanning.
Sourcepub fn search_section(
section: &Section,
query: &str,
case_sensitive: bool,
) -> Vec<SearchResult>
pub fn search_section( section: &Section, query: &str, case_sensitive: bool, ) -> Vec<SearchResult>
Search a single section safely without cross-string offset mismatch panics.
Sourcepub fn search_regex(
sections: &[Section],
pattern: &str,
) -> Result<Vec<SearchResult>, String>
pub fn search_regex( sections: &[Section], pattern: &str, ) -> Result<Vec<SearchResult>, String>
Perform full-text regex pattern search across chapter sections.
Sourcepub fn to_readium_search_json(
results: &[SearchResult],
query: &str,
) -> Result<String, String>
pub fn to_readium_search_json( results: &[SearchResult], query: &str, ) -> Result<String, String>
Format search results into Readium Standard Search Collection JSON (application/vnd.readium.search+json).
Auto Trait Implementations§
impl Freeze for SearchEngine
impl RefUnwindSafe for SearchEngine
impl Send for SearchEngine
impl Sync for SearchEngine
impl Unpin for SearchEngine
impl UnsafeUnpin for SearchEngine
impl UnwindSafe for SearchEngine
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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