pub struct Handle<F: Family> { /* private fields */ }Expand description
A typed view over a Handlers key for the family F.
Implementations§
Source§impl<F: Family> Handle<F>
impl<F: Family> Handle<F>
Sourcepub fn key(&self) -> &HandlerKey
pub fn key(&self) -> &HandlerKey
The key this handle dispatches to.
Sourcepub fn descriptor(&self) -> HandlerDescriptor
pub fn descriptor(&self) -> HandlerDescriptor
The descriptor now: a runtime replacement under the same key is visible. Falls back to the bind-time snapshot when nothing serves the key any more.
Sourcepub fn dispatch(
&self,
request: F::Request,
) -> impl Future<Output = Result<F::Answer, ErrorReport>> + WasmCompatSend + 'static
pub fn dispatch( &self, request: F::Request, ) -> impl Future<Output = Result<F::Answer, ErrorReport>> + WasmCompatSend + 'static
Dispatch a typed request of this family. A request with no wire form fails without reaching a handler or the recorder.
Source§impl Handle<Completion>
impl Handle<Completion>
Sourcepub fn capabilities(&self) -> ProviderCapabilities
pub fn capabilities(&self) -> ProviderCapabilities
The capability snapshot the handler advertises now.
Sourcepub fn call(
&self,
request: CompletionRequest,
) -> impl Future<Output = Result<<Completion as Family>::Answer, ErrorReport>> + WasmCompatSend + 'static
pub fn call( &self, request: CompletionRequest, ) -> impl Future<Output = Result<<Completion as Family>::Answer, ErrorReport>> + WasmCompatSend + 'static
A unary completion.
Sourcepub fn stream(&self, request: CompletionRequest) -> CompletionStream
pub fn stream(&self, request: CompletionRequest) -> CompletionStream
A streamed completion, folded by the returned stream.
Source§impl Handle<Tool>
impl Handle<Tool>
Sourcepub fn call(
&self,
name: impl Into<String>,
args: impl Into<String>,
context: ToolContext,
) -> impl Future<Output = Result<ToolAnswer, ErrorReport>> + WasmCompatSend + 'static
pub fn call( &self, name: impl Into<String>, args: impl Into<String>, context: ToolContext, ) -> impl Future<Output = Result<ToolAnswer, ErrorReport>> + WasmCompatSend + 'static
Call the tool with raw JSON args under context: the context
travels beside the effect to the tool (never on the wire), and the
answer carries what the tool published.
Source§impl Handle<Retrieve>
impl Handle<Retrieve>
Sourcepub fn top_n<T: DeserializeOwned + WasmCompatSend + 'static>(
&self,
req: VectorSearchRequest<Filter<Value>>,
) -> impl Future<Output = Result<Vec<VectorSearchResult<T>>, ErrorReport>> + WasmCompatSend + 'static
pub fn top_n<T: DeserializeOwned + WasmCompatSend + 'static>( &self, req: VectorSearchRequest<Filter<Value>>, ) -> impl Future<Output = Result<Vec<VectorSearchResult<T>>, ErrorReport>> + WasmCompatSend + 'static
Scored documents, deserialized as T.
Sourcepub fn top_n_ids(
&self,
req: VectorSearchRequest<Filter<Value>>,
) -> impl Future<Output = Result<Vec<VectorSearchIdResult>, ErrorReport>> + WasmCompatSend + 'static
pub fn top_n_ids( &self, req: VectorSearchRequest<Filter<Value>>, ) -> impl Future<Output = Result<Vec<VectorSearchIdResult>, ErrorReport>> + WasmCompatSend + 'static
Scored ids.
Trait Implementations§
Auto Trait Implementations§
impl<F> Forget for Handle<F>
impl<F> Freeze for Handle<F>
impl<F> Move for Handle<F>
impl<F> RefUnwindSafe for Handle<F>
impl<F> Send for Handle<F>
impl<F> Sync for Handle<F>
impl<F> Unpin for Handle<F>
impl<F> UnsafeUnpin for Handle<F>
impl<F> UnwindSafe for Handle<F>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more