-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from bgpkit/feature/api-overhaul
Major overhaul
- Loading branch information
Showing
6 changed files
with
459 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use bgpkit_broker::{BgpkitBroker, BrokerItem}; | ||
|
||
pub fn main() { | ||
let broker = BgpkitBroker::new() | ||
.ts_start("1634693400") | ||
.ts_end("1634693400"); | ||
|
||
// method 1: create iterator from reference (so that you can reuse the broker object) | ||
// same as `&broker.into_iter()` | ||
for item in &broker { | ||
println!("{}", item); | ||
} | ||
|
||
// method 2: create iterator from the broker object (taking ownership) | ||
let items = broker.into_iter().collect::<Vec<BrokerItem>>(); | ||
|
||
assert_eq!(items.len(), 106); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//! Queries BGPKIT Broker and get the latest MRT file meta data from all collectors | ||
Oops, something went wrong.