/// Creates a set from the raw route origins and exceptions.
///
/// The function will take all the address origins in `origins`, drop
/// duplicates, drop the origins filtered in `execptions` and add the
/// assertions from `exceptions`.
Creates a set from the raw route origins and exceptions.
Creates a set from the raw route origins and exceptions .
pub fn from_route_origins(
        origins: Vec<RouteOrigins>,
        exceptions: &LocalExceptions,
        extra_info: bool,
        metrics: &mut Metrics,
    ) -> Self {
        let mut res = HashSet::new();
        for mut item in origins {
            let mut tal_metrics = TalMetrics::new(item.tal.clone());
            for mut roa in item {
                tal_metrics.roas += 1;
                let info = OriginInfo::from_roa(&mut roa, extra_info);
                for addr in roa.iter() {
                    tal_metrics.vrps += 1;
                    let addr = AddressOrigin::from_roa(
                        roa.as_id(),
                        addr,
                        info.clone()
                    );
                    if exceptions.keep_origin(&addr) {
                        let _ = res.insert(addr);
                    }
                }
            }
            metrics.push_tal(tal_metrics);
        }
        for addr in exceptions.assertions() {
            let _ = res.insert(addr.clone());
        }
        AddressOrigins {
            origins: res.into_iter().collect()
        }
    }
pub fn from_route_origins ( origins : Vec < RouteOrigins > , exceptions : & LocalExceptions , extra_info : bool , metrics : & mut Metrics , ) -> Self { let mut res = HashSet :: new ( ) ; for mut item in origins { let mut tal_metrics = TalMetrics :: new ( item . tal . clone ( ) ) ; for mut roa in item { tal_metrics . roas += 1 ; let info = OriginInfo :: from_roa ( & mut roa , extra_info ) ; for addr in roa . iter ( ) { tal_metrics . vrps += 1 ; let addr = AddressOrigin :: from_roa ( roa . as_id ( ) , addr , info . clone ( ) ) ; if exceptions . keep_origin ( & addr ) { let _ = res . insert ( addr ) ; } } } metrics . push_tal ( tal_metrics ) ; } for addr in exceptions . assertions ( ) { let _ = res . insert ( addr . clone ( ) ) ; } AddressOrigins { origins : res . into_iter ( ) . collect ( ) } }
Creates a set from the raw route origins and exceptions.
Creates a set from the raw route origins and exceptions .
origins
Vec<RouteOrigins>
exceptions
&LocalExceptions
extra_info
bool
metrics
&mut Metrics