Struct FindSession
pub struct FindSession { /* private fields */ }Expand description
What a find over one Findable has found: how many matches, which is
current, and the query and content they were found for. The FindBar
keeps one, and so does the window bar’s search
(crate::widget::WindowSearch): one engine, whatever draws the field.
Implementations§
§impl FindSession
impl FindSession
pub fn position(&self) -> Option<(usize, usize)>
pub fn position(&self) -> Option<(usize, usize)>
(current, total), 1-based current; None with no current match.
pub fn set_results(&mut self, total: usize, current: Option<usize>)
pub fn set_results(&mut self, total: usize, current: Option<usize>)
The results of a view whose engine finds on its own: total
matches, current the 0-based one shown.
pub fn is_stale(&self, query: &str, options: FindOptions) -> bool
pub fn is_stale(&self, query: &str, options: FindOptions) -> bool
Whether query under options is not what the matches were found for.
pub fn content_moved(&self, target: &dyn Findable) -> bool
pub fn content_moved(&self, target: &dyn Findable) -> bool
Whether the content under the find changed since it last ran.
pub fn search(
&mut self,
target: &mut dyn Findable,
query: &str,
options: FindOptions,
keep: Option<usize>,
)
pub fn search( &mut self, target: &mut dyn Findable, query: &str, options: FindOptions, keep: Option<usize>, )
Find query again and show the match nearest keep (the first
with None): the query or an option changed.
pub fn refresh(
&mut self,
target: &mut dyn Findable,
query: &str,
options: FindOptions,
)
pub fn refresh( &mut self, target: &mut dyn Findable, query: &str, options: FindOptions, )
Find query again without moving the view, keeping the current
match: the content changed under the find. After a replacement the
view applied later, the match now current is shown as after any
replacement.
pub fn replace(
&mut self,
target: &mut dyn Findable,
query: &str,
options: FindOptions,
with: &str,
all: bool,
) -> bool
pub fn replace( &mut self, target: &mut dyn Findable, query: &str, options: FindOptions, with: &str, all: bool, ) -> bool
Replace the current match of query under options with with, or
every match (all), then show the match that is current after it:
the one that followed the replaced match. A view that applies the
edit later is found again once its content moved. Returns whether the
view took the replacement.
pub fn reveal_current(&self, target: &mut dyn Findable) -> bool
pub fn reveal_current(&self, target: &mut dyn Findable) -> bool
Show the current match again (what covers the view changed); whether there was one to show.
pub fn step(&mut self, target: &mut dyn Findable, forward: bool)
pub fn step(&mut self, target: &mut dyn Findable, forward: bool)
Make the next (or previous) match current, wrapping, and show it.
pub fn forget(&mut self)
pub fn forget(&mut self)
Forget the matches without telling a view (it is gone).
Trait Implementations§
§impl Clone for FindSession
impl Clone for FindSession
§fn clone(&self) -> FindSession
fn clone(&self) -> FindSession
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for FindSession
impl Debug for FindSession
§impl Default for FindSession
impl Default for FindSession
§fn default() -> FindSession
fn default() -> FindSession
§impl PartialEq for FindSession
impl PartialEq for FindSession
impl Eq for FindSession
impl StructuralPartialEq for FindSession
Auto Trait Implementations§
impl Freeze for FindSession
impl RefUnwindSafe for FindSession
impl Send for FindSession
impl Sync for FindSession
impl Unpin for FindSession
impl UnsafeUnpin for FindSession
impl UnwindSafe for FindSession
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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