pub struct SearchSnapshot {
pub active: bool,
pub case_sensitive: bool,
pub whole_word: bool,
pub highlight_all: bool,
pub matches: Vec<Range<usize>>,
pub current: Option<usize>,
pub replace_mode: bool,
pub is_replace_prompt: bool,
pub query: String,
pub replacement: String,
}Expand description
Owned snapshot of a hook’s search panel for renderers.
Returned by EditorHook::search_snapshot; editors poll it after input
events to draw toggle chips and the highlight-all wash. Owned (not
borrowed) so hosts can retain it across frames without pinning hooks.
Fields§
§active: boolWhether the hook currently owns the open prompt.
case_sensitive: boolWhether matching is case-sensitive.
whole_word: boolWhether matches must span whole words.
highlight_all: boolWhether all matches wash the viewport (vs current match only).
matches: Vec<Range<usize>>All match byte ranges in ascending order.
current: Option<usize>Index of the current match, if navigation has occurred.
replace_mode: boolWhether replace mode is active in the search panel.
is_replace_prompt: boolWhether the active input prompt is currently the replace field.
query: StringCurrent search query string.
replacement: StringCurrent replacement string.
Trait Implementations§
Source§impl Clone for SearchSnapshot
impl Clone for SearchSnapshot
Source§fn clone(&self) -> SearchSnapshot
fn clone(&self) -> SearchSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SearchSnapshot
impl Debug for SearchSnapshot
Source§impl Default for SearchSnapshot
impl Default for SearchSnapshot
Source§fn default() -> SearchSnapshot
fn default() -> SearchSnapshot
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SearchSnapshot
impl RefUnwindSafe for SearchSnapshot
impl Send for SearchSnapshot
impl Sync for SearchSnapshot
impl Unpin for SearchSnapshot
impl UnsafeUnpin for SearchSnapshot
impl UnwindSafe for SearchSnapshot
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