pub struct Discovery<'a> {
store: StoreId,
adapter: &'a dyn StoreDiscovery,
}Expand description
Validates discovery requests and attaches store identity to results. Constructing a dispatcher performs no I/O and does not enumerate the store. Search and enumeration are synchronous and may block on the adapter’s I/O. Cursor envelopes detect accidental reuse; they do not authenticate input.
Fields§
§store: StoreId§adapter: &'a dyn StoreDiscoveryImplementations§
Source§impl<'a> Discovery<'a>
impl<'a> Discovery<'a>
Sourcepub fn new(store: StoreId, adapter: &'a dyn StoreDiscovery) -> Self
pub fn new(store: StoreId, adapter: &'a dyn StoreDiscovery) -> Self
Bind an adapter to its stable registry identity. The caller supplies a unique, persistent ID; this does not register a store.
Sourcepub fn capabilities(&self) -> DiscoveryCapabilities
pub fn capabilities(&self) -> DiscoveryCapabilities
Describe the adapter’s search fields and enumeration limits.
Sourcepub fn search(&self, query: &SearchQuery) -> Result<SearchPage<StoredCandidate>>
pub fn search(&self, query: &SearchQuery) -> Result<SearchPage<StoredCandidate>>
Validate and search one page, preserving the source of every result.
Sourcepub fn enumerate(
&self,
request: &PageRequest,
) -> Result<SearchPage<StoredCandidate>>
pub fn enumerate( &self, request: &PageRequest, ) -> Result<SearchPage<StoredCandidate>>
Validate and enumerate one page; search support alone does not allow this.
Sourcefn finish(
&self,
page: SearchPage,
scope: &RequestScope,
request: &PageRequest,
) -> Result<SearchPage<StoredCandidate>>
fn finish( &self, page: SearchPage, scope: &RequestScope, request: &PageRequest, ) -> Result<SearchPage<StoredCandidate>>
Enforce response bounds, reject a stalled cursor, and preserve result origin. Empty result pages are valid when filtering leaves a continuation to follow.