pub struct Handle(/* private fields */);
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.
Auto Trait Implementations§
impl Freeze for Handle
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnwindSafe for Handle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more