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§
sourcetype HelloFut: Future<Output = String>
type HelloFut: Future<Output = String>
The response future returned by AspenRpc::hello
.
sourcetype NewRtKactusFut: Future<Output = bool>
type NewRtKactusFut: Future<Output = bool>
The response future returned by AspenRpc::new_rt_kactus
.
Required Methods§
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§
sourcefn serve(self) -> ServeAspenRpc<Self>
fn serve(self) -> ServeAspenRpc<Self>
Returns a serving function to use with InFlightRequest::execute.
Object Safety§
This trait is not object safe.