RouteSampler

Trait RouteSampler 

Source
pub trait RouteSampler {
    // Required method
    fn sample<P: Prefix, Q, Ospf: OspfImpl>(
        &mut self,
        net: &Network<P, Q, Ospf>,
    ) -> impl IntoIterator<Item = (RouterId, usize)>;
}
Expand description

A function samples route preferences.

Required Methods§

Source

fn sample<P: Prefix, Q, Ospf: OspfImpl>( &mut self, net: &Network<P, Q, Ospf>, ) -> impl IntoIterator<Item = (RouterId, usize)>

Return an iterator of routes to advertise. Each item should be a tuple of RouterId (the router that advertises the route) and the AS path length that should be advertised from that router.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl RouteSampler for &[(RouterId, usize)]

Source§

fn sample<P: Prefix, Q, Ospf: OspfImpl>( &mut self, _net: &Network<P, Q, Ospf>, ) -> impl IntoIterator<Item = (RouterId, usize)>

Source§

impl RouteSampler for BTreeMap<RouterId, usize>

Source§

fn sample<P: Prefix, Q, Ospf: OspfImpl>( &mut self, _net: &Network<P, Q, Ospf>, ) -> impl IntoIterator<Item = (RouterId, usize)>

Source§

impl RouteSampler for Vec<(RouterId, usize)>

Source§

fn sample<P: Prefix, Q, Ospf: OspfImpl>( &mut self, _net: &Network<P, Q, Ospf>, ) -> impl IntoIterator<Item = (RouterId, usize)>

Source§

impl RouteSampler for HashMap<RouterId, usize>

Source§

fn sample<P: Prefix, Q, Ospf: OspfImpl>( &mut self, _net: &Network<P, Q, Ospf>, ) -> impl IntoIterator<Item = (RouterId, usize)>

Implementors§