pub struct DocumentFindState {
pub query: DocumentFindQuery,
pub count: usize,
pub matches: Vec<DocumentFindMatch>,
pub current: Option<usize>,
pub complete: bool,
}Expand description
The retained result model shared by retained documents and hosted engines.
Fields§
§query: DocumentFindQuery§count: usizeAuthoritative number of matches. Engines that can describe individual
matches also populate matches; engine-managed pages may expose only
this count and the current ordinal.
matches: Vec<DocumentFindMatch>§current: Option<usize>Zero-based index into matches.
complete: boolHosted engines may report progressive counts. Static sessions are complete in their first answer.
Implementations§
Source§impl DocumentFindState
impl DocumentFindState
pub fn empty(query: DocumentFindQuery) -> Self
Sourcepub fn engine_managed(
query: DocumentFindQuery,
count: usize,
active_match: Option<usize>,
complete: bool,
) -> Self
pub fn engine_managed( query: DocumentFindQuery, count: usize, active_match: Option<usize>, complete: bool, ) -> Self
Adapt an engine-managed count/current callback into the same retained model used by static sessions. The engine remains responsible for revealing the selected occurrence.
pub fn current_match(&self) -> Option<&DocumentFindMatch>
Trait Implementations§
Source§impl Clone for DocumentFindState
impl Clone for DocumentFindState
Source§impl Debug for DocumentFindState
impl Debug for DocumentFindState
Source§impl<'de> Deserialize<'de> for DocumentFindState
impl<'de> Deserialize<'de> for DocumentFindState
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
Source§impl PartialEq for DocumentFindState
impl PartialEq for DocumentFindState
Source§impl Serialize for DocumentFindState
impl Serialize for DocumentFindState
impl StructuralPartialEq for DocumentFindState
Auto Trait Implementations§
impl Forget for DocumentFindState
impl Freeze for DocumentFindState
impl RefUnwindSafe for DocumentFindState
impl Send for DocumentFindState
impl Sync for DocumentFindState
impl Unpin for DocumentFindState
impl UnsafeUnpin for DocumentFindState
impl UnwindSafe for DocumentFindState
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