[−][src]Struct smoltcp::iface::Routes
A routing table.
Examples
On systems with heap, this table can be created with:
use std::collections::BTreeMap; use smoltcp::iface::Routes; let mut routes = Routes::new(BTreeMap::new());
On systems without heap, use:
use smoltcp::iface::Routes; let mut routes_storage = []; let mut routes = Routes::new(&mut routes_storage[..]);
Methods
impl<'a> Routes<'a>
[src]
pub fn new<T>(storage: T) -> Routes<'a> where
T: Into<ManagedMap<'a, IpCidr, Route>>,
[src]
T: Into<ManagedMap<'a, IpCidr, Route>>,
Creates a routing tables. The backing storage is not cleared upon creation.
pub fn update<F: FnOnce(&mut ManagedMap<'a, IpCidr, Route>)>(&mut self, f: F)
[src]
Update the routes of this node.
pub fn add_default_ipv4_route(
&mut self,
gateway: Ipv4Address
) -> Result<Option<Route>>
[src]
&mut self,
gateway: Ipv4Address
) -> Result<Option<Route>>
Add a default ipv4 gateway (ie. "ip route add 0.0.0.0/0 via gateway
").
On success, returns the previous default route, if any.
pub fn add_default_ipv6_route(
&mut self,
gateway: Ipv6Address
) -> Result<Option<Route>>
[src]
&mut self,
gateway: Ipv6Address
) -> Result<Option<Route>>
Add a default ipv6 gateway (ie. "ip -6 route add ::/0 via gateway
").
On success, returns the previous default route, if any.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Routes<'a>
impl<'a> Send for Routes<'a>
impl<'a> Sync for Routes<'a>
impl<'a> Unpin for Routes<'a>
impl<'a> !UnwindSafe for Routes<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,