Struct OpenResourceSearch
pub struct OpenResourceSearch { /* private fields */ }Expand description
Automatic bounded search over the resources an app currently has open.
Apps still provide explicit SearchProviders for large or closed
collections (all mail, every file, every contact). This provider closes the
baseline gap: a live resource published by any app is findable by its label,
kind, or stable id even when the app has no bespoke content index. One canonical
representative action activates the resource; the palette continues to
list every action separately from the same fresh authority tree.
Implementations§
§impl OpenResourceSearch
impl OpenResourceSearch
pub fn new(resources: &[Resource]) -> OpenResourceSearch
Trait Implementations§
§impl Clone for OpenResourceSearch
impl Clone for OpenResourceSearch
§fn clone(&self) -> OpenResourceSearch
fn clone(&self) -> OpenResourceSearch
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 more§impl SearchProvider for OpenResourceSearch
impl SearchProvider for OpenResourceSearch
§fn name(&self) -> &'static str
fn name(&self) -> &'static str
The kind label this provider produces, used for diagnostics and as the
default group header. Individual results may still carry a different
SearchResult::kind.§fn search(&self, query: &str) -> Vec<SearchResult>
fn search(&self, query: &str) -> Vec<SearchResult>
Return the matching results for
query. An empty query conventionally
returns a provider’s “browse” set (recents / favourites / all), or an
empty vec if browsing makes no sense for the source.§fn search_limited(&self, query: &str, limit: usize) -> Vec<SearchResult>
fn search_limited(&self, query: &str, limit: usize) -> Vec<SearchResult>
Query with a materialisation budget. App providers must override this
and stop constructing hits once
limit is reached. The fallback exists
only for tiny/test providers outside apps/; the repository contract
checker rejects app implementations that inherit it.§fn search_page(
&self,
query: &SearchQuery,
cursor: Option<&SearchCursor>,
work_budget: usize,
result_limit: usize,
) -> SearchPage
fn search_page( &self, query: &SearchQuery, cursor: Option<&SearchCursor>, work_budget: usize, result_limit: usize, ) -> SearchPage
Return one bounded continuation page for an interactive search. Read more
§fn resolve_action_resource(&self, address: &ActionAddress) -> Option<Resource>
fn resolve_action_resource(&self, address: &ActionAddress) -> Option<Resource>
Lazily resolve a canonical search address that is intentionally absent
from the small open-resource snapshot.
§fn action_directory_generation(&self) -> Option<u64>
fn action_directory_generation(&self) -> Option<u64>
Monotonic retained-index generation for the broker pull directory.
None means the provider has not proved that a continuation cursor is
safe across mutation, so remote directory discovery must omit it
rather than silently advertise mutable rows as revision-stable.
Providers backed by SearchCatalog should return
Some(catalog.stats().generation).§fn action_directory_invocation_domain(&self) -> ActionDirectoryInvocationDomain
fn action_directory_invocation_domain(&self) -> ActionDirectoryInvocationDomain
Versions this actual provider’s complete lazy invocation domain, including
hidden targets and argument/handler semantics omitted from search rows.
§fn action_directory_cursor_is_current(&self, _cursor: &SearchCursor) -> bool
fn action_directory_cursor_is_current(&self, _cursor: &SearchCursor) -> bool
Validate a continuation token before it is used by a remote pull
directory. The conservative default refuses it: only providers that
expose a retained generation may claim continuation safety.
§fn poll_page(&self, _token: &PendingToken) -> PagePoll
fn poll_page(&self, _token: &PendingToken) -> PagePoll
The page a
SearchPage::pending token stands for, once its source
has answered. Called on later frames, never in a loop; return
PagePoll::Pending until the answer is in. A token the provider no
longer knows (the query moved on) answers an empty ready page.§fn facets(&self) -> Vec<Facet>
fn facets(&self) -> Vec<Facet>
The dimensions this provider filters by. The palette offers their
values as chips and parses typed
key:value tokens for them into
SearchQuery::filters.§fn search_scopes(&self) -> Vec<ScopeDecl>
fn search_scopes(&self) -> Vec<ScopeDecl>
The parts of the app this provider’s hits can be narrowed to (see
ScopeDecl). An unscoped palette offers each as a
“Search in” row that narrows the search to it.Auto Trait Implementations§
impl Freeze for OpenResourceSearch
impl !RefUnwindSafe for OpenResourceSearch
impl Send for OpenResourceSearch
impl Sync for OpenResourceSearch
impl Unpin for OpenResourceSearch
impl UnsafeUnpin for OpenResourceSearch
impl !UnwindSafe for OpenResourceSearch
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
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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>
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