Function mrt::read_file_complete

source ·
pub fn read_file_complete(file: File) -> Result<Vec<MrtEntry>, &'static str>
Expand description

Reads the given file and returns a vector of all MrtEntry found in that file

This potentially uses a lot of RAM, and it’s likely better to use MrtFile instead

Example

use std::fs::File;

let f = File::open("example_data/openbgpd_rib_table-v2").unwrap();
let entries = mrt::read_file_complete(f).unwrap();
for entry in &entries {
    println!("{:?}", entry);
}