Skip to main content

RowSource

Trait RowSource 

Source
pub trait RowSource<R: SearchRow>:
    Send
    + Sync
    + 'static {
    // Required method
    fn load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        emit: Emit<R>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn leading_row(&self, _query: &str) -> Option<R> { ... }
    fn reload_on_query(&self) -> bool { ... }
}
Expand description

Where a SearchList’s rows come from. Vault-backed in the app, in-memory in tests. Streaming vs one-shot is a delivery detail of the SAME seam.

Required Methods§

Source

fn load<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, emit: Emit<R>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Called on construction and on every committed query change. Empty query = initial state. Write rows into emit. Cancel-safe: the engine drops the prior load on requery, so a slow source may be left unfinished.

Provided Methods§

Source

fn leading_row(&self, _query: &str) -> Option<R>

An optional synthetic leading row (the “Create: ” affordance), prepended and exempt from local filtering. Keeps create-policy here.

Source

fn reload_on_query(&self) -> bool

true (default): load is re-run on every query keystroke (server-side filter). false: load runs once with "", then a local Filter narrows the set per keystroke.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§