pub trait CustomCompleterFactory: Send + Sync {
type CustomCompleter: CustomCompleter + 'static;
// Required method
fn build(
&self,
ctx: &RootCtx<'_>,
) -> impl Future<Output = Self::CustomCompleter>;
}Expand description
A factory for CustomCompleters.
Having a two-step construction flow is useful to avoid constantly
re-initializing “expensive” objects during custom completion (e.g:
re-parsing a TOML file on every invocation to CustomComplete::complete).
Required Associated Types§
Sourcetype CustomCompleter: CustomCompleter + 'static
type CustomCompleter: CustomCompleter + 'static
The concrete CustomCompleter.
Required Methods§
Sourcefn build(
&self,
ctx: &RootCtx<'_>,
) -> impl Future<Output = Self::CustomCompleter>
fn build( &self, ctx: &RootCtx<'_>, ) -> impl Future<Output = Self::CustomCompleter>
Build a new CustomCompleter.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.