Skip to content

Commit 0cd6b39

Browse files
committed
Update readme and cargo toml for smol and repo move
1 parent f1642e1 commit 0cd6b39

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ edition = "2018"
66
# - Update CHANGELOG.md.
77
# - Update doc URL.
88
# - Create "v0.1.x" git tag.
9-
version = "0.2.0"
9+
version = "0.3.0"
1010
license = "MIT"
1111
readme = "README.md"
1212
description = """
1313
Async/Stream Extensions for libpcap
1414
"""
15-
authors = ["Danny Browning <bdbrowning2@gmail.com>", "Ben Kornmeier <ben@kornstar.net>"]
15+
authors = ["dbcfd <bdbrowning2@gmail.com>", "Ben Kornmeier <ben@kornstar.net>"]
1616
categories = ["asynchronous", "network-programming"]
1717
documentation = "https://docs.rs/pcap-async/"
1818
repository = "https://github.com/dbcfd/pcap-async"

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
[![docs.rs docs][docs-badge]][docs-url]
66
[![MIT licensed][mit-badge]][mit-url]
77

8-
Rust async wrapper around [pcap-sys](https://github.com/protectwise/pcap-sys). Utilizes [Futures 0.3](https://github.com/rust-lang-nursery/futures-rs) and [Tokio](https://github.com/tokio-rs/tokio).
8+
Rust async wrapper around [pcap-sys](https://github.com/protectwise/pcap-sys). Utilizes [Futures 0.3](https://github.com/rust-lang-nursery/futures-rs) and [Smol](https://github.com/stjepang/smol).
99

1010
[Documentation](https://docs.rs/pcap-async/latest/)
1111

12-
[travis-badge]: https://travis-ci.com/dbcfd/pcap-async.svg?branch=master
13-
[travis-url]: https://travis-ci.com/dbcfd/pcap-async
12+
[travis-badge]: https://travis-ci.com/protectwise/pcap-async.svg?branch=master
13+
[travis-url]: https://travis-ci.com/protectwise/pcap-async
1414
[crates-badge]: https://img.shields.io/crates/v/pcap-async.svg?style=flat-square
1515
[crates-url]: https://crates.io/crates/pcap-async
1616
[docs-badge]: https://img.shields.io/badge/docs.rs-latest-blue.svg?style=flat-square
@@ -24,7 +24,7 @@ First, add this to your `Cargo.toml`:
2424

2525
```toml
2626
[dependencies]
27-
pcap-async = "0.1"
27+
pcap-async = "0.3"
2828
```
2929

3030
Next, add this to your crate:
@@ -33,15 +33,16 @@ Next, add this to your crate:
3333
use futures::StreamExt;
3434
use pcap_async::{Config, Handle, PacketStream};
3535

36-
#[tokio::main]
37-
async fn main() {
38-
let handle = Handle::lookup().expect("No handle created");
39-
let mut provider = PacketStream::new(Config::default(), handle)
40-
.expect("Could not create provider")
41-
.fuse();
42-
while let Some(packets) = provider.next().await {
43-
44-
}
45-
handle.interrupt();
36+
fn main() {
37+
smol::run(async move {
38+
let handle = Handle::lookup().expect("No handle created");
39+
let mut provider = PacketStream::new(Config::default(), handle)
40+
.expect("Could not create provider")
41+
.fuse();
42+
while let Some(packets) = provider.next().await {
43+
44+
}
45+
handle.interrupt();
46+
})
4647
}
4748
```

0 commit comments

Comments
 (0)