Rpc

Trait Rpc 

Source
pub trait Rpc:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn state(&self) -> BoxFuture<Result<Option<LightBlock>>>;
    fn status(&self) -> BoxFuture<Result<LatestStatus>>;

    // Provided method
    fn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M> { ... }
}

Required Methods§

Source

fn state(&self) -> BoxFuture<Result<Option<LightBlock>>>

Returns the latest trusted block.

Source

fn status(&self) -> BoxFuture<Result<LatestStatus>>

Returns the latest status.

Provided Methods§

Source

fn to_delegate<M: Metadata>(self) -> IoDelegate<Self, M>

Create an IoDelegate, wiring rpc calls to the trait methods.

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.

Implementors§

Source§

impl<H> Rpc for Server<H>
where H: Handle + Send + Sync + 'static,