Skip to main content

HandshakeConnection

Trait HandshakeConnection 

Source
pub trait HandshakeConnection {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn request<'a>(
        &'a mut self,
        method: &'static str,
        params: Value,
    ) -> HandshakeFuture<'a, Value, Self::Error>;
    fn notify<'a>(
        &'a mut self,
        method: &'static str,
    ) -> HandshakeFuture<'a, (), Self::Error>;
}
Expand description

The request/notification subset the initialization state machine needs.

The full connection implements this seam; tests can use a scripted fake without a real process, network, clock, or runtime.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

The transport failure type.

Required Methods§

Source

fn request<'a>( &'a mut self, method: &'static str, params: Value, ) -> HandshakeFuture<'a, Value, Self::Error>

Sends one request and resolves to its raw JSON result.

Source

fn notify<'a>( &'a mut self, method: &'static str, ) -> HandshakeFuture<'a, (), Self::Error>

Sends one notification, which has no params and gets no answer.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§