Struct bgpkit_parser::parser::BgpkitParser
source · pub struct BgpkitParser<R> { /* private fields */ }
Implementations§
source§impl<R> BgpkitParser<R>
impl<R> BgpkitParser<R>
pub fn into_record_iter(self) -> RecordIterator<R> ⓘ
pub fn into_elem_iter(self) -> ElemIterator<R> ⓘ
source§impl BgpkitParser<Box<dyn Read + Send>>
impl BgpkitParser<Box<dyn Read + Send>>
sourcepub fn new(path: &str) -> Result<Self, ParserErrorWithBytes>
pub fn new(path: &str) -> Result<Self, ParserErrorWithBytes>
Creating a new parser from a object that implements Read trait.
sourcepub fn new_cached(
path: &str,
cache_dir: &str
) -> Result<Self, ParserErrorWithBytes>
pub fn new_cached( path: &str, cache_dir: &str ) -> Result<Self, ParserErrorWithBytes>
Creating a new parser that also caches the remote content to a local cache directory.
The cache file name is generated by the following format: cache-<crc32 of file name>-<file name>
.
For example, the remote file http://archive.routeviews.org/route-views.chile/bgpdata/2023.03/RIBS/rib.20230326.0600.bz2
will be cached as cache-682cb1eb-rib.20230326.0600.bz2
in the cache directory.
source§impl<R: Read> BgpkitParser<R>
impl<R: Read> BgpkitParser<R>
sourcepub fn from_reader(reader: R) -> Self
pub fn from_reader(reader: R) -> Self
Creating a new parser from a object that implements Read trait.
sourcepub fn next_record(&mut self) -> Result<MrtRecord, ParserErrorWithBytes>
pub fn next_record(&mut self) -> Result<MrtRecord, ParserErrorWithBytes>
This is used in for loop for item in parser{}