#[non_exhaustive]pub struct FindQuery {
pub text: String,
pub case_sensitive: bool,
pub whole_word: bool,
pub regex: bool,
}Expand description
An active find query: the pattern plus its option flags.
PartialEq so the Document surface can no-op an unchanged query without
re-scanning — the flags are part of that identity, because each one changes
what matches, not how it is displayed.
The flags pick the matcher: plain text takes the literal byte scan;
whole_word or regex take the line-scoped engine.
#[non_exhaustive] so a future option can be added without a breaking
change: outside this crate, build one with FindQuery::new (a plain
literal query) and set the options you want on its public fields, rather
than a struct literal.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.text: StringThe text to find — a literal, or a regular expression when
regex is set. Empty means “no matches” (never
match-all).
case_sensitive: boolWhen false, a/A fold together. Case folding is ASCII-only in the
literal matcher, and Unicode-aware in the regex one.
whole_word: boolMatch only whole words — the ab| option. A match must be bounded by
non-word characters (or the edges of its line) on both sides.
regex: boolTreat text as a regular expression — the .* option.
Matching is line-scoped: the engine is fed one line at a time, so a
pattern can never match across a newline. An invalid
pattern is not an error state — it is what every prefix of a pattern
being typed looks like — so it simply yields no matches, and
FindState::pattern_error carries the reason for the bar to show.
Implementations§
Trait Implementations§
impl Eq for FindQuery
impl StructuralPartialEq for FindQuery
Auto Trait Implementations§
impl Freeze for FindQuery
impl RefUnwindSafe for FindQuery
impl Send for FindQuery
impl Sync for FindQuery
impl Unpin for FindQuery
impl UnsafeUnpin for FindQuery
impl UnwindSafe for FindQuery
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.