File tree 2 files changed +3
-4
lines changed
examples/minimal_client_service/src
2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ fn main() -> Result<(), Error> {
18
18
let node = rclrs:: create_node ( & context, "minimal_service" ) ?;
19
19
20
20
let _server = node
21
- . create_service :: < example_interfaces:: srv:: AddTwoInts , _ > ( "add_two_ints" , handle_service) ?;
21
+ . create_service :: < example_interfaces:: srv:: AddTwoInts > ( "add_two_ints" , handle_service) ?;
22
22
23
23
println ! ( "Starting server" ) ;
24
24
rclrs:: spin ( node) . map_err ( |err| err. into ( ) )
Original file line number Diff line number Diff line change @@ -263,14 +263,13 @@ impl Node {
263
263
///
264
264
/// [1]: crate::Service
265
265
// TODO: make service's lifetime depend on node's lifetime
266
- pub fn create_service < T , F > (
266
+ pub fn create_service < T > (
267
267
& self ,
268
268
topic : & str ,
269
- callback : F ,
269
+ callback : impl FnMut ( & rmw_request_id_t , T :: Request ) -> T :: Response + ' static + Send ,
270
270
) -> Result < Arc < Service < T > > , RclrsError >
271
271
where
272
272
T : rosidl_runtime_rs:: Service ,
273
- F : FnMut ( & rmw_request_id_t , T :: Request ) -> T :: Response + ' static + Send ,
274
273
{
275
274
let service = Arc :: new ( Service :: < T > :: new (
276
275
Arc :: clone ( & self . rcl_node_mtx ) ,
You can’t perform that action at this time.
0 commit comments