1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-08-14 07:40:31 +02:00

Compare commits

...

21 Commits

Author SHA1 Message Date
Rob Ede
97e8c571cf chore(actix-server): prepare release 2.5.0
closes #586
2024-08-04 22:41:04 +01:00
Rob Ede
0d8c7e5085 build: add nix flake 2024-08-04 22:39:19 +01:00
Rob Ede
baf1b6042a docs(server): update changelog 2024-08-04 22:34:17 +01:00
dependabot[bot]
779fa28bd5 build(deps): bump taiki-e/install-action from 2.42.4 to 2.42.10 (#587)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.42.4 to 2.42.10.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/v2.42.4...v2.42.10)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 19:40:21 +00:00
dependabot[bot]
e282811d69 build(deps): update rustversion-msrv requirement from 0.99 to 0.100 (#584)
---
updated-dependencies:
- dependency-name: rustversion-msrv
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 19:27:49 +00:00
dependabot[bot]
5c44115978 build(deps): bump taiki-e/install-action from 2.42.0 to 2.42.4 (#585)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.42.0 to 2.42.4.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/v2.42.0...v2.42.4)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 18:56:19 +00:00
Rob Ede
ead0e2b200 chore: fix nightly warnings 2024-07-20 18:57:00 +01:00
Rob Ede
ace737fc4c chore: overspecified deps 2024-07-20 18:00:39 +01:00
dependabot[bot]
c45ae294fb build(deps): bump taiki-e/install-action from 2.41.11 to 2.42.0 (#583)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.41.11 to 2.42.0.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/v2.41.11...v2.42.0)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 02:14:15 +00:00
dependabot[bot]
939377f6ab build(deps): bump taiki-e/install-action from 2.41.7 to 2.41.11 (#582)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.41.7 to 2.41.11.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/v2.41.7...v2.41.11)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 21:40:27 +00:00
dependabot[bot]
20149f957b build(deps): bump JamesIves/github-pages-deploy-action (#581)
Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.6.1 to 4.6.3.
- [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases)
- [Commits](https://github.com/jamesives/github-pages-deploy-action/compare/v4.6.1...v4.6.3)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 21:40:25 +00:00
dependabot[bot]
544e5d3b40 build(deps): bump taiki-e/install-action from 2.41.3 to 2.41.7 (#579)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.41.3 to 2.41.7.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/v2.41.3...v2.41.7)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 01:08:35 +00:00
dependabot[bot]
d482af529c build(deps): bump taiki-e/install-action from 2.39.1 to 2.41.3 (#578)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.39.1 to 2.41.3.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/v2.39.1...v2.41.3)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 16:32:28 +00:00
Rob Ede
0030800b9a chore: update mio dependency to v1 (#577) 2024-06-20 01:22:33 +01:00
dependabot[bot]
64fa2f8462 build(deps): bump taiki-e/install-action from 2.38.1 to 2.39.1 (#574)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.38.1 to 2.39.1.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/v2.38.1...v2.39.1)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 20:52:59 +00:00
dependabot[bot]
b0d1c8d193 build(deps): bump codecov/codecov-action from 4.4.1 to 4.5.0 (#575)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.4.1 to 4.5.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4.4.1...v4.5.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 20:52:48 +00:00
Jiri Andras
46cc62c6d8 Fix logging "starting service:..." (#573)
Co-authored-by: Jiří Andras <jiri.andras@braiins.cz>
2024-06-14 17:11:32 +00:00
dependabot[bot]
912daa3d0a build(deps): bump taiki-e/cache-cargo-install-action from 2.0.0 to 2.0.1 (#570)
Bumps [taiki-e/cache-cargo-install-action](https://github.com/taiki-e/cache-cargo-install-action) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/taiki-e/cache-cargo-install-action/releases)
- [Changelog](https://github.com/taiki-e/cache-cargo-install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/cache-cargo-install-action/compare/v2.0.0...v2.0.1)

---
updated-dependencies:
- dependency-name: taiki-e/cache-cargo-install-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 19:36:41 +00:00
dependabot[bot]
aefa810496 build(deps): bump actions-rust-lang/setup-rust-toolchain (#571)
Bumps [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/actions-rust-lang/setup-rust-toolchain/releases)
- [Changelog](https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1.8.0...v1.9.0)

---
updated-dependencies:
- dependency-name: actions-rust-lang/setup-rust-toolchain
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 19:36:09 +00:00
dependabot[bot]
2c443a7620 build(deps): bump taiki-e/install-action from 2.34.1 to 2.38.1 (#572)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.34.1 to 2.38.1.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/v2.34.1...v2.38.1)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 19:35:52 +00:00
Rob Ede
b3b1583115 docs: update changelog 2024-06-09 18:08:53 +01:00
20 changed files with 154 additions and 43 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

View File

@@ -59,12 +59,12 @@ jobs:
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV
- name: Install Rust (${{ matrix.version }}) - name: Install Rust (${{ matrix.version }})
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
with: with:
toolchain: ${{ matrix.version }} toolchain: ${{ matrix.version }}
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
uses: taiki-e/install-action@v2.34.1 uses: taiki-e/install-action@v2.42.10
with: with:
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
@@ -116,12 +116,12 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install Rust (nightly) - name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
with: with:
toolchain: nightly toolchain: nightly
- name: Install cargo-hack & cargo-minimal-versions - name: Install cargo-hack & cargo-minimal-versions
uses: taiki-e/install-action@v2.34.1 uses: taiki-e/install-action@v2.42.10
with: with:
tool: cargo-hack,cargo-minimal-versions tool: cargo-hack,cargo-minimal-versions
@@ -135,10 +135,10 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install Rust - name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
- name: Install cargo-nextest - name: Install cargo-nextest
uses: taiki-e/install-action@v2.34.1 uses: taiki-e/install-action@v2.42.10
with: with:
tool: cargo-nextest tool: cargo-nextest

View File

@@ -68,12 +68,12 @@ jobs:
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV
- name: Install Rust (${{ matrix.version.name }}) - name: Install Rust (${{ matrix.version.name }})
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
with: with:
toolchain: ${{ matrix.version.version }} toolchain: ${{ matrix.version.version }}
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
uses: taiki-e/install-action@v2.34.1 uses: taiki-e/install-action@v2.42.10
with: with:
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
@@ -120,12 +120,12 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install Rust (nightly) - name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
with: with:
toolchain: nightly toolchain: nightly
- name: Install just - name: Install just
uses: taiki-e/install-action@v2.34.1 uses: taiki-e/install-action@v2.42.10
with: with:
tool: just tool: just

View File

@@ -18,12 +18,12 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install Rust - name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
with: with:
components: llvm-tools-preview components: llvm-tools-preview
- name: Install cargo-llvm-cov - name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2.34.1 uses: taiki-e/install-action@v2.42.10
with: with:
tool: cargo-llvm-cov tool: cargo-llvm-cov
@@ -31,7 +31,7 @@ jobs:
run: cargo llvm-cov --workspace --all-features --codecov --output-path codecov.json run: cargo llvm-cov --workspace --all-features --codecov --output-path codecov.json
- name: Upload coverage to Codecov - name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.4.1 uses: codecov/codecov-action@v4.5.0
with: with:
files: codecov.json files: codecov.json
fail_ci_if_error: true fail_ci_if_error: true

View File

@@ -18,7 +18,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 - uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
with: with:
toolchain: nightly toolchain: nightly
components: rustfmt components: rustfmt
@@ -35,7 +35,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 - uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
with: { components: clippy } with: { components: clippy }
- uses: giraffate/clippy-action@v1.0.1 - uses: giraffate/clippy-action@v1.0.1
@@ -50,17 +50,17 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install Rust (nightly-2023-10-10) - name: Install Rust (nightly-2023-10-10)
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
with: with:
toolchain: nightly-2023-10-10 toolchain: nightly-2023-10-10
- name: Install just - name: Install just
uses: taiki-e/install-action@v2.34.1 uses: taiki-e/install-action@v2.42.10
with: with:
tool: just tool: just
- name: Install cargo-check-external-types - name: Install cargo-check-external-types
uses: taiki-e/cache-cargo-install-action@v2.0.0 uses: taiki-e/cache-cargo-install-action@v2.0.1
with: with:
tool: cargo-check-external-types@0.1.10 tool: cargo-check-external-types@0.1.10

View File

@@ -20,7 +20,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1.8.0 - uses: actions-rust-lang/setup-rust-toolchain@v1.9.0
with: { toolchain: nightly } with: { toolchain: nightly }
- name: Build Docs - name: Build Docs
@@ -30,7 +30,7 @@ jobs:
run: echo '<meta http-equiv="refresh" content="0;url=actix_server/index.html">' > target/doc/index.html run: echo '<meta http-equiv="refresh" content="0;url=actix_server/index.html">' > target/doc/index.html
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.6.1 uses: JamesIves/github-pages-deploy-action@v4.6.3
with: with:
folder: target/doc folder: target/doc
single-commit: true single-commit: true

4
.gitignore vendored
View File

@@ -13,4 +13,8 @@ guide/build/
# These are backup files generated by rustfmt # These are backup files generated by rustfmt
**/*.rs.bk **/*.rs.bk
# IDEs
.idea .idea
# direnv
/.direnv

View File

@@ -32,5 +32,5 @@ proc-macro2 = "1.0.60"
[dev-dependencies] [dev-dependencies]
actix-rt = "2" actix-rt = "2"
futures-util = { version = "0.3.17", default-features = false } futures-util = { version = "0.3.17", default-features = false }
rustversion-msrv = "0.99" rustversion-msrv = "0.100"
trybuild = "1" trybuild = "1"

View File

@@ -4,7 +4,7 @@
## 2.10.0 ## 2.10.0
- Relax bound (`F: Fn -> FnOnce`) on `{Arbiter, System}::with_tokio_rt()` functions. - Relax `F`'s bound (`Fn => FnOnce`) on `{Arbiter, System}::with_tokio_rt()` functions.
- Update `tokio-uring` dependency to `0.5`. - Update `tokio-uring` dependency to `0.5`.
- Minimum supported Rust version (MSRV) is now 1.70. - Minimum supported Rust version (MSRV) is now 1.70.

View File

@@ -2,6 +2,10 @@
## Unreleased ## Unreleased
## 2.5.0
- Update `mio` dependency to `1`.
## 2.4.0 ## 2.4.0
- Update `tokio-uring` dependency to `0.5`. - Update `tokio-uring` dependency to `0.5`.

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "actix-server" name = "actix-server"
version = "2.4.0" version = "2.5.0"
authors = [ authors = [
"Nikolay Kim <fafhrd91@gmail.com>", "Nikolay Kim <fafhrd91@gmail.com>",
"Rob Ede <robjtede@icloud.com>", "Rob Ede <robjtede@icloud.com>",
@@ -31,7 +31,7 @@ actix-utils = "3"
futures-core = { version = "0.3.17", default-features = false, features = ["alloc"] } futures-core = { version = "0.3.17", default-features = false, features = ["alloc"] }
futures-util = { version = "0.3.17", default-features = false, features = ["alloc"] } futures-util = { version = "0.3.17", default-features = false, features = ["alloc"] }
mio = { version = "0.8", features = ["os-poll", "net"] } mio = { version = "1", features = ["os-poll", "net"] }
socket2 = "0.5" socket2 = "0.5"
tokio = { version = "1.23.1", features = ["sync"] } tokio = { version = "1.23.1", features = ["sync"] }
tracing = { version = "0.1.30", default-features = false, features = ["log"] } tracing = { version = "0.1.30", default-features = false, features = ["log"] }

View File

@@ -5,11 +5,11 @@
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->
[![crates.io](https://img.shields.io/crates/v/actix-server?label=latest)](https://crates.io/crates/actix-server) [![crates.io](https://img.shields.io/crates/v/actix-server?label=latest)](https://crates.io/crates/actix-server)
[![Documentation](https://docs.rs/actix-server/badge.svg?version=2.4.0)](https://docs.rs/actix-server/2.4.0) [![Documentation](https://docs.rs/actix-server/badge.svg?version=2.5.0)](https://docs.rs/actix-server/2.5.0)
[![Version](https://img.shields.io/badge/rustc-1.52+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html) [![Version](https://img.shields.io/badge/rustc-1.52+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html)
![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-server.svg) ![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-server.svg)
<br /> <br />
[![Dependency Status](https://deps.rs/crate/actix-server/2.4.0/status.svg)](https://deps.rs/crate/actix-server/2.4.0) [![Dependency Status](https://deps.rs/crate/actix-server/2.5.0/status.svg)](https://deps.rs/crate/actix-server/2.5.0)
![Download](https://img.shields.io/crates/d/actix-server.svg) ![Download](https://img.shields.io/crates/d/actix-server.svg)
[![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x) [![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x)

View File

@@ -183,11 +183,6 @@ impl ServerInner {
} }
fn run_sync(mut builder: ServerBuilder) -> io::Result<(Self, ServerEventMultiplexer)> { fn run_sync(mut builder: ServerBuilder) -> io::Result<(Self, ServerEventMultiplexer)> {
let sockets = mem::take(&mut builder.sockets)
.into_iter()
.map(|t| (t.0, t.2))
.collect();
// Give log information on what runtime will be used. // Give log information on what runtime will be used.
let is_actix = actix_rt::System::try_current().is_some(); let is_actix = actix_rt::System::try_current().is_some();
let is_tokio = tokio::runtime::Handle::try_current().is_ok(); let is_tokio = tokio::runtime::Handle::try_current().is_ok();
@@ -207,6 +202,11 @@ impl ServerInner {
); );
} }
let sockets = mem::take(&mut builder.sockets)
.into_iter()
.map(|t| (t.0, t.2))
.collect();
let (waker_queue, worker_handles, accept_handle) = Accept::start(sockets, &builder)?; let (waker_queue, worker_handles, accept_handle) = Accept::start(sockets, &builder)?;
let mux = ServerEventMultiplexer { let mux = ServerEventMultiplexer {

View File

@@ -126,7 +126,7 @@ pub(crate) enum SocketAddr {
Unknown, Unknown,
Tcp(StdSocketAddr), Tcp(StdSocketAddr),
#[cfg(unix)] #[cfg(unix)]
Uds(mio::net::SocketAddr), Uds(std::os::unix::net::SocketAddr),
} }
impl fmt::Display for SocketAddr { impl fmt::Display for SocketAddr {

View File

@@ -228,6 +228,7 @@ mod tests {
use super::*; use super::*;
// pseudo-doctest for Transform trait // pseudo-doctest for Transform trait
#[allow(unused)]
pub struct TimeoutTransform { pub struct TimeoutTransform {
timeout: Duration, timeout: Duration,
} }
@@ -249,6 +250,7 @@ mod tests {
} }
// pseudo-doctest for Transform trait // pseudo-doctest for Transform trait
#[allow(unused)]
pub struct Timeout<S> { pub struct Timeout<S> {
service: S, service: S,
_timeout: Duration, _timeout: Duration,

View File

@@ -22,9 +22,9 @@ allowed_external_types = [
[dependencies] [dependencies]
bytes = { version = "1.2", default-features = false } bytes = { version = "1.2", default-features = false }
serde = { version = "1.0", optional = true } serde = { version = "1", optional = true }
[dev-dependencies] [dev-dependencies]
ahash = { version = "0.8", default-features = false } ahash = { version = "0.8", default-features = false }
serde_json = "1.0" serde_json = "1"
static_assertions = "1.1" static_assertions = "1.1"

View File

@@ -9,7 +9,7 @@ coverage:
default: default:
threshold: 10% # make CI green threshold: 10% # make CI green
ignore: # ignore codecoverage on following paths ignore: # ignore code coverage on following paths
- "examples" - "examples"
- ".github" - ".github"
- "**/*.md" - "**/*.md"

58
flake.lock generated Normal file
View File

@@ -0,0 +1,58 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1715865404,
"narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1722651103,
"narHash": "sha256-IRiJA0NVAoyaZeKZluwfb2DoTpBAj+FLI0KfybBeDU0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a633d89c6dc9a2a8aae11813a62d7c58b2c0cc51",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1714640452,
"narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

30
flake.nix Normal file
View File

@@ -0,0 +1,30 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
perSystem = { pkgs, config, inputs', system, lib, ... }: {
formatter = pkgs.nixpkgs-fmt;
devShells.default = pkgs.mkShell {
packages = [
config.formatter
pkgs.fd
pkgs.just
pkgs.nodePackages.prettier
pkgs.taplo
pkgs.watchexec
] ++ lib.optional pkgs.stdenv.isDarwin [
pkgs.pkgsBuildHost.darwin.apple_sdk.frameworks.Security
pkgs.pkgsBuildHost.darwin.apple_sdk.frameworks.CoreFoundation
pkgs.pkgsBuildHost.darwin.apple_sdk.frameworks.SystemConfiguration
pkgs.pkgsBuildHost.libiconv
];
};
};
};
}

View File

@@ -1,6 +1,23 @@
_list: _list:
@just --list @just --list
# Check project.
check: && clippy
just --unstable --fmt --check
# nixpkgs-fmt --check .
fd --hidden --type=file -e=md -e=yml --exec-batch prettier --check
fd --hidden -e=toml --exec-batch taplo format --check
fd --hidden -e=toml --exec-batch taplo lint
cargo +nightly fmt -- --check
# Format project.
fmt:
just --unstable --fmt
# nixpkgs-fmt .
fd --hidden --type=file -e=md -e=yml --exec-batch prettier --write
fd --type=file --hidden -e=toml --exec-batch taplo format
cargo +nightly fmt
# Downgrade dev-dependencies necessary to run MSRV checks/tests. # Downgrade dev-dependencies necessary to run MSRV checks/tests.
[private] [private]
downgrade-for-msrv: downgrade-for-msrv:
@@ -12,7 +29,6 @@ msrv := ```
| sed -E 's/^1\.([0-9]{2})$/1\.\1\.0/' | sed -E 's/^1\.([0-9]{2})$/1\.\1\.0/'
``` ```
msrv_rustup := "+" + msrv msrv_rustup := "+" + msrv
non_linux_all_features_list := ``` non_linux_all_features_list := ```
cargo metadata --format-version=1 \ cargo metadata --format-version=1 \
| jq '.packages[] | select(.source == null) | .features | keys' \ | jq '.packages[] | select(.source == null) | .features | keys' \
@@ -20,19 +36,15 @@ non_linux_all_features_list := ```
--arg exclusions "tokio-uring,io-uring" \ --arg exclusions "tokio-uring,io-uring" \
'add | unique | . - ($exclusions | split(",")) | join(",")' 'add | unique | . - ($exclusions | split(",")) | join(",")'
``` ```
all_crate_features := if os() == "linux" { "--all-features" } else { "--features='" + non_linux_all_features_list + "'" }
all_crate_features := if os() == "linux" {
"--all-features"
} else {
"--features='" + non_linux_all_features_list + "'"
}
# Run Clippy over workspace. # Run Clippy over workspace.
clippy toolchain="": clippy toolchain="":
cargo {{ toolchain }} clippy --workspace --all-targets {{ all_crate_features }} cargo {{ toolchain }} clippy --workspace --all-targets {{ all_crate_features }}
# Test workspace code. # Test workspace code.
[macos, windows] [macos]
[windows]
test toolchain="": test toolchain="":
cargo {{ toolchain }} test --lib --tests --package=actix-macros cargo {{ toolchain }} test --lib --tests --package=actix-macros
cargo {{ toolchain }} nextest run --workspace --exclude=actix-macros --no-default-features cargo {{ toolchain }} nextest run --workspace --exclude=actix-macros --no-default-features