fn vrps(
        config: Config,
        output: Option<PathBuf>,
        format: OutputFormat,
        noupdate: bool
    ) -> Result<(), Error> {
        let repo = config.create_repository(format.extra_output(), !noupdate)?;
        config.switch_logging(false)?;
        let exceptions = repo.load_exceptions(&config)?;

        if repo.update().is_err() {
            warn!("Update failed. Continuing anyway.");
        }
        let roas = match repo.process() {
            Ok(roas) => roas,
            Err(_) => {
                error!("Validation failed. Aborting.");
                return Err(Error)
            }
        };
        debug!("Found {} ROAs.", roas.len());
        let mut metrics = Metrics::new();
        let vrps = AddressOrigins::from_route_origins(
            roas, &exceptions, format.extra_output(), &mut metrics
        );
        metrics.log();
        let res = match output {
            Some(ref path) => {
                let mut file = match fs::File::create(path) {
                    Ok(file) => file,
                    Err(err) => {
                        error!(
                            "Failed to open output file '{}': {}",
                            path.display(), err
                        );
                        return Err(Error)
                    }
                };
                format.output(&vrps, &mut file)
            }
            None => {
                let out = io::stdout();
                let mut out = out.lock();
                format.output(&vrps, &mut out)
            }
        };
        res.map_err(|err| {
            error!(
                "Failed to output result: {}",
                err
            );
            Error
        })
    }
/// Produces a list of Validated ROA Payload.
///
/// The list will be written to the file identified by `output` or
/// stdout if that is `None`. The format is determined by `format`.
/// If `noupdate` is `false`, the local repository will be updated first
/// and rsync will be enabled during validation to sync any new
/// publication points.
Produces a list of Validated ROA Payload.
The list will be written to the file identified by `output` or
stdout if that is `None`. The format is determined by `format`.
If `noupdate` is `false`, the local repository will be updated first
and rsync will be enabled during validation to sync any new
publication points.
Produces a list of Validated ROA Payload . The list will be written to the file identified by ` output ` or stdout if that is ` None ` . The format is determined by ` format ` . If ` noupdate ` is ` false ` the local repository will be updated first and rsync will be enabled during validation to sync any new publication points .
fn vrps(
        config: Config,
        output: Option<PathBuf>,
        format: OutputFormat,
        noupdate: bool
    ) -> Result<(), Error> {
        let repo = config.create_repository(format.extra_output(), !noupdate)?;
        config.switch_logging(false)?;
        let exceptions = repo.load_exceptions(&config)?;
        if repo.update().is_err() {
            warn!("Update failed. Continuing anyway.");
        }
        let roas = match repo.process() {
            Ok(roas) => roas,
            Err(_) => {
                error!("Validation failed. Aborting.");
                return Err(Error)
            }
        };
        debug!("Found {} ROAs.", roas.len());
        let mut metrics = Metrics::new();
        let vrps = AddressOrigins::from_route_origins(
            roas, &exceptions, format.extra_output(), &mut metrics
        );
        metrics.log();
        let res = match output {
            Some(ref path) => {
                let mut file = match fs::File::create(path) {
                    Ok(file) => file,
                    Err(err) => {
                        error!(
                            "Failed to open output file '{}': {}",
                            path.display(), err
                        );
                        return Err(Error)
                    }
                };
                format.output(&vrps, &mut file)
            }
            None => {
                let out = io::stdout();
                let mut out = out.lock();
                format.output(&vrps, &mut out)
            }
        };
        res.map_err(|err| {
            error!(
                "Failed to output result: {}",
                err
            );
            Error
        })
    }
fn vrps ( config : Config , output : Option < PathBuf > , format : OutputFormat , noupdate : bool ) -> Result < ( ) , Error > { let repo = config . create_repository ( format . extra_output ( ) , ! noupdate ) ? ; config . switch_logging ( false ) ? ; let exceptions = repo . load_exceptions ( & config ) ? ; if repo . update ( ) . is_err ( ) { warn ! ( " " ) ; } let roas = match repo . process ( ) { Ok ( roas ) => roas , Err ( _ ) => { error ! ( " " ) ; return Err ( Error ) } } ; debug ! ( " " roas len ( ) ) ; let mut metrics = Metrics :: new ( ) ; let vrps = AddressOrigins :: from_route_origins ( roas , & exceptions , format . extra_output ( ) , & mut metrics ) ; metrics . log ( ) ; let res = match output { Some ( ref path ) => { let mut file = match fs :: File :: create ( path ) { Ok ( file ) => file , Err ( err ) => { error ! ( " " path display ( ) err ) ; return Err ( Error ) } } ; format . output ( & vrps , & mut file ) } None => { let out = io :: stdout ( ) ; let mut out = out . lock ( ) ; format . output ( & vrps , & mut out ) } } ; res . map_err ( | err | { error ! ( " " err ) ; Error } ) }
Produces a list of Validated ROA Payload.
Produces a list of Validated ROA Payload .
config
Config
output
Option<PathBuf>
format
OutputFormat
noupdate
bool
config
Config
output
Option<PathBuf>
format
OutputFormat
noupdate
bool