pub struct Handle(_);Expand description
Handle that abstracts initialization and cleanup of resources needed to operate on the routing table.
Implementations§
source§impl Handle
impl Handle
pub fn new() -> Result<Self>
sourcepub fn route_listen_stream(&self) -> impl Stream<Item = RouteChange>
pub fn route_listen_stream(&self) -> impl Stream<Item = RouteChange>
Returns a Stream which will yield a RouteChange event whenever a route is added, removed, or changed from the system’s routing table.
sourcepub async fn list(&self) -> Result<Vec<Route>>
pub async fn list(&self) -> Result<Vec<Route>>
Returns a Vec<Route> containing a list of both ipv4 and v6 routes on the system.
sourcepub async fn default_route(&self) -> Result<Option<Route>>
pub async fn default_route(&self) -> Result<Option<Route>>
Get one of the default routes on the system if there is at least one.