Trait aspenlib::AspenRpc

source ·
pub trait AspenRpc: Sized {
    type HelloFut: Future<Output = String>;
    type NewRtKactusFut: Future<Output = bool>;

    // Required methods
    fn hello(self, context: Context, name: String) -> Self::HelloFut;
    fn new_rt_kactus(
        self,
        context: Context,
        realtime_feed_id: String,
        vehicles: Option<Vec<u8>>,
        trips: Option<Vec<u8>>,
        alerts: Option<Vec<u8>>
    ) -> Self::NewRtKactusFut;

    // Provided method
    fn serve(self) -> ServeAspenRpc<Self> { ... }
}
Expand description

This is the service definition. It looks a lot like a trait definition. It defines one RPC, hello, which takes one arg, name, and returns a String.

Required Associated Types§

source

type HelloFut: Future<Output = String>

The response future returned by AspenRpc::hello.

source

type NewRtKactusFut: Future<Output = bool>

The response future returned by AspenRpc::new_rt_kactus.

Required Methods§

source

fn hello(self, context: Context, name: String) -> Self::HelloFut

Returns a greeting for name.

source

fn new_rt_kactus( self, context: Context, realtime_feed_id: String, vehicles: Option<Vec<u8>>, trips: Option<Vec<u8>>, alerts: Option<Vec<u8>> ) -> Self::NewRtKactusFut

Provided Methods§

source

fn serve(self) -> ServeAspenRpc<Self>

Returns a serving function to use with InFlightRequest::execute.

Object Safety§

This trait is not object safe.

Implementors§