Skip to main content

Module index

Module index 

Source
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 returns DispatchResult::Immediate(vec![(port, Box::new(value) as Box<dyn SlotValue>)])value lands in the slot table as Box<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 returns DispatchResult::Async(cmd_id) and parks the dispatched op until the user calls handle.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.