pub struct Search { /* private fields */ }Expand description
A comprehensive search engine supporting regex queries and case insensitivity.
Implementations§
Source§impl Search
impl Search
Sourcepub fn is_match(&self, text: &str) -> bool
pub fn is_match(&self, text: &str) -> bool
Evaluates if the provided text satisfies the current search filter.
Sourcepub fn set_text(&mut self, text: impl Into<String>)
pub fn set_text(&mut self, text: impl Into<String>)
Updates the raw query string and regenerates the matcher state.
Sourcepub fn set_options(&mut self, options: SearchOptions)
pub fn set_options(&mut self, options: SearchOptions)
Replaces the active search options.
Sourcepub fn toggle_option(&mut self, option: SearchOptions)
pub fn toggle_option(&mut self, option: SearchOptions)
Toggles a specific search behavior option.
Sourcepub fn edit_text(&mut self, f: impl FnOnce(&mut String) -> bool) -> bool
pub fn edit_text(&mut self, f: impl FnOnce(&mut String) -> bool) -> bool
Permits safe mutability of the search query, rebuilding state on changes.
Sourcepub const fn options(&self) -> SearchOptions
pub const fn options(&self) -> SearchOptions
Exposes the current search configuration options.
Sourcepub fn error_message(&self) -> Option<&str>
pub fn error_message(&self) -> Option<&str>
Exposes localized error messages if a regex query fails compilation.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Search
impl<'de> Deserialize<'de> for Search
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Search
impl RefUnwindSafe for Search
impl Send for Search
impl Sync for Search
impl Unpin for Search
impl UnsafeUnpin for Search
impl UnwindSafe for Search
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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