Macro toy_rpc::macros::service[][src]

service!() { /* proc-macro */ }

Find the exported methods with the provided path

Example

struct Foo { }
 
#[export_impl]
impl Foo { 
    //rpc service impl here
}
 
mod rpc {
    pub struct Bar { }
 
    #[export_impl]
    impl Bar {
        //rpc service impl here
    }
}
 
use toy_rpc::Server;
 
fn main() {
    let foo = Arc::new(Foo {});
    let bar = Arc::new(rpc::Bar {});
     
    let server = Server::builder()
        .register(foo)
        .register(bar)
        .build();
}