pub struct Route<I: Ip> {
pub destination: Subnet<I::Addr>,
pub action: RouteAction<I>,
pub properties: RouteProperties,
}
Expand description
A route, abstracting over fnet_routes::RouteV4
and
fnet_routes::RouteV6
.
The destination
subnet is verified to be a valid subnet; e.g. its
prefix-len is a valid value, and its host bits are cleared.
Fields§
§destination: Subnet<I::Addr>
The destination subnet of the route.
action: RouteAction<I>
The action specifying how to handle packets matching this route.
properties: RouteProperties
The additional properties of the route.
Implementations§
Source§impl<I: Ip> Route<I>
impl<I: Ip> Route<I>
Sourcepub fn new_forward(
destination: Subnet<I::Addr>,
outbound_interface: u64,
next_hop: Option<SpecifiedAddr<I::Addr>>,
metric: SpecifiedMetric,
) -> Self
pub fn new_forward( destination: Subnet<I::Addr>, outbound_interface: u64, next_hop: Option<SpecifiedAddr<I::Addr>>, metric: SpecifiedMetric, ) -> Self
Constructs a new route with metric metric
that forwards any packets to destination
over
outbound_interface
.
Sourcepub fn new_forward_with_inherited_metric(
destination: Subnet<I::Addr>,
outbound_interface: u64,
next_hop: Option<SpecifiedAddr<I::Addr>>,
) -> Self
pub fn new_forward_with_inherited_metric( destination: Subnet<I::Addr>, outbound_interface: u64, next_hop: Option<SpecifiedAddr<I::Addr>>, ) -> Self
Constructs a new route that forwards any packets to destination
over
outbound_interface
, inheriting outbound_interface
’s metric.
Sourcepub fn new_forward_with_explicit_metric(
destination: Subnet<I::Addr>,
outbound_interface: u64,
next_hop: Option<SpecifiedAddr<I::Addr>>,
metric: u32,
) -> Self
pub fn new_forward_with_explicit_metric( destination: Subnet<I::Addr>, outbound_interface: u64, next_hop: Option<SpecifiedAddr<I::Addr>>, metric: u32, ) -> Self
outbound_interface
.
Trait Implementations§
Source§impl<I: Ord + Ip> Ord for Route<I>
impl<I: Ord + Ip> Ord for Route<I>
Source§impl<I: PartialOrd + Ip> PartialOrd for Route<I>where
I::Addr: PartialOrd,
impl<I: PartialOrd + Ip> PartialOrd for Route<I>where
I::Addr: PartialOrd,
impl<I: Copy + Ip> Copy for Route<I>
impl<I: Eq + Ip> Eq for Route<I>
impl<I: Ip> StructuralPartialEq for Route<I>
Auto Trait Implementations§
impl<I> Freeze for Route<I>
impl<I> RefUnwindSafe for Route<I>
impl<I> Send for Route<I>
impl<I> Sync for Route<I>
impl<I> Unpin for Route<I>
impl<I> UnwindSafe for Route<I>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
Source§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.