LanguageServerCommand

Trait LanguageServerCommand 

Source
pub trait LanguageServerCommand<P>:
    Send
    + Sync
    + 'static
where Self::Future: Send + 'static,
{ type Future: Future<Output = Result<Self::Output, ServerError<Self::Error>>> + Send + 'static; type Output: Serialize; type Error: Serialize; // Required method fn execute(&self, param: P) -> Self::Future; // Provided method fn invalid_params(&self) -> Option<Self::Error> { ... } }

Required Associated Types§

Source

type Future: Future<Output = Result<Self::Output, ServerError<Self::Error>>> + Send + 'static

Source

type Output: Serialize

Source

type Error: Serialize

Required Methods§

Source

fn execute(&self, param: P) -> Self::Future

Provided Methods§

Source

fn invalid_params(&self) -> Option<Self::Error>

Implementors§

Source§

impl<'de, F, R, P, O, E> LanguageServerCommand<P> for F
where F: Fn(P) -> R + Send + Sync + 'static, R: Future<Output = Result<O, ServerError<E>>> + Send + 'static, P: Deserialize<'de>, O: Serialize, E: Serialize,

Source§

type Future = <F as FnOnce(P)>::Output

Source§

type Output = O

Source§

type Error = E