Expand description
bb::Index — Contract trait for vector indexes.
Each method takes the engine’s &mut RuntimeResourceRef<'_> ctx
plus a CompletionHandle AND returns ContractResponse. The
impl declares per call:
- [
ContractResponse::Now(Ok(value))] — result is ready inline. The handle is ignored; the framework returnsDispatchResult::Immediate(vec![(port, Box::new(value) as Box<dyn SlotValue>)])—valuelands in the slot table asBox<dyn SlotValue>with no serialization at this boundary — and skips the park / ingress-drain cycle. ContractResponse::Later— the impl retained the handle (sent it to a worker thread, spawned a tokio task, queued a remote RPC). The framework returnsDispatchResult::Async(cmd_id)and parks the dispatched op until the user callshandle.complete(result)from off-thread.
ctx is the per-dispatch runtime surface: impls reach their
declared #[depends(...)] siblings through
RuntimeResourceRef::dependency (e.g. an index that delegates
distance math to a bound Backend).
Traits§
- Index
- User-facing Contract trait for a vector index.