Skip to main content

pamoja_router_route_at

Function pamoja_router_route_at 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_router_route_at( router: *const PamojaRouter, index: usize, out_route: *mut PamojaRoute, ) -> bool
Expand description

Returns one of the routes a table holds, by its position among them.

Positions count the routes held from zero, in the order the table holds them, so reading positions 0 to pamoja_router_len minus one lists the whole table.

§Arguments

  • router - the routing table.
  • index - the position of the route, counting from zero.
  • out_route - receives the route.

§Returns

true with *out_route filled in, or false when the table holds no route at that position.

§Safety

router must be a live handle from pamoja_router_new, or null, and out_route must point to a writable PamojaRoute.