pub struct FunctionCompletionHandler { /* private fields */ }
Expand description
Function-based completion handler
Implementations§
Source§impl FunctionCompletionHandler
impl FunctionCompletionHandler
Sourcepub fn new<F, Fut>(handler: F) -> Selfwhere
F: Fn(CompleteRequestParams, RequestContext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = ServerResult<CompletionResponse>> + Send + 'static,
pub fn new<F, Fut>(handler: F) -> Selfwhere
F: Fn(CompleteRequestParams, RequestContext) -> Fut + Send + Sync + 'static,
Fut: Future<Output = ServerResult<CompletionResponse>> + Send + 'static,
Create a new function-based completion handler
Trait Implementations§
Source§impl CompletionHandler for FunctionCompletionHandler
impl CompletionHandler for FunctionCompletionHandler
Source§fn handle<'life0, 'async_trait>(
&'life0 self,
request: CompleteRequestParams,
ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<CompletionResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle<'life0, 'async_trait>(
&'life0 self,
request: CompleteRequestParams,
ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<CompletionResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a completion request
Source§fn get_completions<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_reference: &'life1 str,
_argument: Option<&'life2 str>,
_partial_value: Option<&'life3 str>,
_ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<Vec<Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get_completions<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_reference: &'life1 str,
_argument: Option<&'life2 str>,
_partial_value: Option<&'life3 str>,
_ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<Vec<Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Get completion suggestions based on context
Source§fn max_completions(&self) -> usize
fn max_completions(&self) -> usize
Get maximum number of completions to return
Source§fn supports_completion(&self, _reference: &str) -> bool
fn supports_completion(&self, _reference: &str) -> bool
Check if completion is supported for the given reference
Auto Trait Implementations§
impl Freeze for FunctionCompletionHandler
impl !RefUnwindSafe for FunctionCompletionHandler
impl Send for FunctionCompletionHandler
impl Sync for FunctionCompletionHandler
impl Unpin for FunctionCompletionHandler
impl !UnwindSafe for FunctionCompletionHandler
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