File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,37 @@ parse ADIF data in Rust on top of tokio.
1616
1717## Usage
1818
19+ Add the dependency:
20+
1921``` sh
2022cargo add TBD
2123```
2224
25+ Then start reading ADIF from any object that implements the AsyncRead trait:
26+
27+ ``` rust,no_run
28+ # use adif::RecordStream;
29+ # use futures::StreamExt;
30+ # use tokio::fs::File;
31+ # use tokio::io::BufReader;
32+ #
33+ # #[tokio::main(flavor = "current_thread")]
34+ # async fn main() -> Result<(), Box<dyn std::error::Error>> {
35+ # let path = "";
36+ let file = File::open(path).await?;
37+ let reader = BufReader::new(file);
38+ let mut stream = RecordStream::new(reader, true);
39+
40+ while let Some(result) = stream.next().await {
41+ let record = result?;
42+ if let Some(call) = record.get("call") {
43+ println!("call: {}", call.as_str());
44+ }
45+ }
46+ #
47+ # Ok(())
48+ # }
49+ ```
2350See examples or documentation for further information.
2451
2552## Features
You can’t perform that action at this time.
0 commit comments