Skip to content

Commit c60d29b

Browse files
committed
feat: impl NetworkInterface for Linux, macOS and Windows
0 parents  commit c60d29b

24 files changed

+1896
-0
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!--
2+
Developer's Certificate of Origin 1.1
3+
4+
By making a contribution to this project, I certify that:
5+
6+
(a) The contribution was created in whole or in part by me and I
7+
have the right to submit it under the open source license
8+
indicated in the file; or
9+
10+
(b) The contribution is based upon previous work that, to the best
11+
of my knowledge, is covered under an appropriate open source
12+
license and I have the right under that license to submit that
13+
work with modifications, whether created in whole or in part
14+
by me, under the same open source license (unless I am
15+
permitted to submit under a different license), as indicated
16+
in the file; or
17+
18+
(c) The contribution was provided directly to me by some other
19+
person who certified (a), (b) or (c) and I have not modified
20+
it.
21+
22+
(d) I understand and agree that this project and the contribution
23+
are public and that a record of the contribution (including all
24+
personal information I submit with it, including my sign-off) is
25+
maintained indefinitely and may be redistributed consistent with
26+
this project or the open source license(s) involved.
27+
-->

.github/workflows/build.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: build
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build:
11+
name: Builds on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [
16+
ubuntu-latest,
17+
windows-latest,
18+
macOS-latest
19+
]
20+
21+
steps:
22+
- uses: actions/checkout@v1
23+
24+
- uses: actions-rs/toolchain@v1
25+
with:
26+
profile: minimal
27+
toolchain: stable
28+
29+
- name: Build
30+
run: cargo build --release --locked

.github/workflows/clippy.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: clippy
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
clippy:
10+
name: Runs "cargo clippy" on ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [
15+
ubuntu-latest,
16+
windows-latest,
17+
macOS-latest
18+
]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- uses: actions-rs/toolchain@v1
24+
with:
25+
profile: minimal
26+
toolchain: stable
27+
override: true
28+
components: clippy
29+
30+
- name: Cache .cargo and target
31+
uses: actions/cache@v2
32+
with:
33+
path: |
34+
~/.cargo
35+
./target
36+
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
39+
${{ runner.os }}-cargo-clippy
40+
41+
- name: cargo clippy
42+
uses: actions-rs/cargo@v1
43+
with:
44+
command: clippy
45+
args: -- -D warnings

.github/workflows/fmt.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: fmt
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
fmt:
10+
name: Runs "cargo fmt" on ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [
15+
ubuntu-latest,
16+
windows-latest,
17+
macOS-latest
18+
]
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
24+
- uses: actions-rs/toolchain@v1
25+
with:
26+
profile: minimal
27+
toolchain: stable
28+
override: true
29+
components: rustfmt
30+
31+
- name: Cache .cargo and target
32+
uses: actions/cache@v2
33+
with:
34+
path: |
35+
~/.cargo
36+
./target
37+
key: ${{ runner.os }}-cargo-fmt-${{ hashFiles('**/Cargo.lock') }}
38+
restore-keys: |
39+
${{ runner.os }}-cargo-fmt-${{ hashFiles('**/Cargo.lock') }}
40+
${{ runner.os }}-cargo-fmt
41+
42+
- name: Run fmt
43+
uses: actions-rs/cargo@v1
44+
with:
45+
command: fmt
46+
args: --all -- --check

.github/workflows/release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish-dry-run:
10+
name: "Runs cargo publish --dry-run"
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v1
14+
15+
- uses: actions-rs/toolchain@v1
16+
with:
17+
profile: minimal
18+
toolchain: stable
19+
20+
- name: publish crate
21+
run: cargo publish --dry-run
22+
23+
create-release:
24+
name: Create Release
25+
needs: publish-dry-run
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v2
30+
31+
- name: Create Release
32+
id: create_release
33+
uses: actions/create-release@v1
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
with:
37+
tag_name: ${{ github.ref }}
38+
release_name: ${{ github.ref }}
39+
body: ''
40+
draft: false
41+
prerelease: false
42+
43+
publish-crate:
44+
name: Publish to crates.io
45+
needs: create-release
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v1
49+
50+
- uses: actions-rs/toolchain@v1
51+
with:
52+
profile: minimal
53+
toolchain: stable
54+
- run: cargo login ${CRATES_IO_TOKEN}
55+
env:
56+
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
57+
58+
- name: publish crate
59+
run: cargo publish

.github/workflows/test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: test
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
name: Runs "cargo test" on ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [
15+
ubuntu-latest,
16+
windows-latest,
17+
macOS-latest
18+
]
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
24+
- uses: actions-rs/toolchain@v1
25+
with:
26+
profile: minimal
27+
toolchain: stable
28+
override: true
29+
30+
- name: Cache .cargo and target
31+
uses: actions/cache@v2
32+
with:
33+
path: |
34+
~/.cargo
35+
./target
36+
key: ${{ runner.os }}-cargo-fmt-${{ hashFiles('**/Cargo.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-cargo-fmt-${{ hashFiles('**/Cargo.lock') }}
39+
${{ runner.os }}-cargo-fmt
40+
41+
- name: Run tests
42+
uses: actions-rs/cargo@v1
43+
with:
44+
command: test
45+
args: -- --nocapture

.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Application Related #
2+
#######################
3+
.vscode/
4+
/target
5+
6+
# Compiled source #
7+
###################
8+
*.com
9+
*.class
10+
*.dll
11+
*.exe
12+
*.o
13+
*.so
14+
bundle
15+
16+
# Packages #
17+
############
18+
# it's better to unpack these files and commit the raw source
19+
# git has its own built in compression methods
20+
*.7z
21+
*.dmg
22+
*.gz
23+
*.iso
24+
*.jar
25+
*.rar
26+
*.tar
27+
*.zip
28+
29+
# Logs and databases #
30+
######################
31+
*.log
32+
*.sqlite
33+
34+
# OS generated files #
35+
######################
36+
.DS_Store
37+
.DS_Store?
38+
._*
39+
.Spotlight-V100
40+
.Trashes
41+
ehthumbs.db
42+
Thumbs.db

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [0.0.1] - 2021-09-23
8+
### Added
9+
- First release

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting [email protected].
58+
59+
All complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

0 commit comments

Comments
 (0)