pub trait PickerSource:
Send
+ Sync
+ 'static {
// Required methods
fn search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
db: &'life1 Db,
q: &'life2 str,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<PickerNode>, PickerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
db: &'life1 Db,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PickerNode>, PickerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
A source of picker candidates: a domain service the picker field and its
endpoints call. Implementors build SQL in a scoped block and drop the builder
before awaiting (sea-query identifiers are not Send), as the store queries
elsewhere do.
Required Methods§
Sourcefn search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
db: &'life1 Db,
q: &'life2 str,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<PickerNode>, PickerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
db: &'life1 Db,
q: &'life2 str,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<PickerNode>, PickerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Candidates matching q, capped at limit (the caller clamps it).
Sourcefn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
db: &'life1 Db,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PickerNode>, PickerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
db: &'life1 Db,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PickerNode>, PickerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
The node a stored id refers to, or None if it no longer exists.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".