mirror of https://github.com/fafhrd91/actix-net
Compare commits
43 Commits
bytestring
...
master
Author | SHA1 | Date |
---|---|---|
|
b57ab7e8f0 | |
|
887975ab11 | |
|
9069fd8590 | |
|
8204690568 | |
|
bbb3139c45 | |
|
0915904bdb | |
|
70f0008f42 | |
|
12df4d7027 | |
|
6f5b81d2a0 | |
|
4cf37171b5 | |
|
00f40e1471 | |
|
15f0b63492 | |
|
9d4b1673aa | |
|
fc902b2d56 | |
|
f4175a4ad4 | |
|
323a2e2931 | |
|
4b9f7ae46d | |
|
0e119fd9b2 | |
|
b04b88e81a | |
|
0a8f2baa11 | |
|
d79d500ffe | |
|
7a7e3de430 | |
|
f062ede06f | |
|
1338276934 | |
|
4746b4e2fa | |
|
0509f0cede | |
|
3831e0d7fe | |
|
60945d0481 | |
|
2615a19e28 | |
|
1a0f44fff1 | |
|
8d1cd2ec87 | |
|
b87174b5f2 | |
|
8097af6a27 | |
|
ecba6e21da | |
|
23f797a81d | |
|
d2a5091451 | |
|
e0c09c2aa4 | |
|
8234543066 | |
|
34826c6253 | |
|
42b788d131 | |
|
9796593b24 | |
|
c362fc4414 | |
|
52733337e4 |
|
@ -1,10 +1,12 @@
|
|||
## PR Type
|
||||
|
||||
<!-- What kind of change does this PR make? -->
|
||||
<!-- Bug Fix / Feature / Refactor / Code Style / Other -->
|
||||
|
||||
INSERT_PR_TYPE
|
||||
|
||||
|
||||
## PR Checklist
|
||||
|
||||
Check your PR fulfills the following:
|
||||
|
||||
<!-- For draft PRs check the boxes as you complete them. -->
|
||||
|
@ -14,11 +16,10 @@ Check your PR fulfills the following:
|
|||
- [ ] A changelog entry has been made for the appropriate packages.
|
||||
- [ ] Format code with the latest stable rustfmt
|
||||
|
||||
|
||||
## Overview
|
||||
|
||||
<!-- Describe the current and new behavior. -->
|
||||
<!-- Emphasize any breaking changes. -->
|
||||
|
||||
|
||||
<!-- If this PR fixes or closes an issue, reference it here. -->
|
||||
<!-- Closes #000 -->
|
||||
|
|
|
@ -47,7 +47,7 @@ jobs:
|
|||
|
||||
- name: Install nasm
|
||||
if: matrix.target.os == 'windows-latest'
|
||||
uses: ilammy/setup-nasm@v1.5.1
|
||||
uses: ilammy/setup-nasm@v1.5.2
|
||||
|
||||
- name: Install OpenSSL
|
||||
if: matrix.target.os == 'windows-latest'
|
||||
|
@ -59,12 +59,12 @@ jobs:
|
|||
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV
|
||||
|
||||
- name: Install Rust (${{ matrix.version }})
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
with:
|
||||
toolchain: ${{ matrix.version }}
|
||||
|
||||
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
|
||||
uses: taiki-e/install-action@v2.44.71
|
||||
uses: taiki-e/install-action@v2.49.34
|
||||
with:
|
||||
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
|
||||
|
||||
|
@ -116,31 +116,14 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust (nightly)
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
with:
|
||||
toolchain: nightly
|
||||
|
||||
- name: Install cargo-hack & cargo-minimal-versions
|
||||
uses: taiki-e/install-action@v2.44.71
|
||||
uses: taiki-e/install-action@v2.49.34
|
||||
with:
|
||||
tool: cargo-hack,cargo-minimal-versions
|
||||
|
||||
- name: Check With Minimal Versions
|
||||
run: cargo minimal-versions check
|
||||
|
||||
nextest:
|
||||
name: nextest
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
|
||||
- name: Install cargo-nextest
|
||||
uses: taiki-e/install-action@v2.44.71
|
||||
with:
|
||||
tool: cargo-nextest
|
||||
|
||||
- name: Test with cargo-nextest
|
||||
run: cargo nextest run
|
||||
|
|
|
@ -56,7 +56,7 @@ jobs:
|
|||
|
||||
- name: Install nasm
|
||||
if: matrix.target.os == 'windows-latest'
|
||||
uses: ilammy/setup-nasm@v1.5.1
|
||||
uses: ilammy/setup-nasm@v1.5.2
|
||||
|
||||
- name: Install OpenSSL
|
||||
if: matrix.target.os == 'windows-latest'
|
||||
|
@ -68,12 +68,12 @@ jobs:
|
|||
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV
|
||||
|
||||
- name: Install Rust (${{ matrix.version.name }})
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
with:
|
||||
toolchain: ${{ matrix.version.version }}
|
||||
|
||||
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
|
||||
uses: taiki-e/install-action@v2.44.71
|
||||
uses: taiki-e/install-action@v2.49.34
|
||||
with:
|
||||
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
|
||||
|
||||
|
@ -120,12 +120,12 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust (nightly)
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
with:
|
||||
toolchain: nightly
|
||||
|
||||
- name: Install just
|
||||
uses: taiki-e/install-action@v2.44.71
|
||||
uses: taiki-e/install-action@v2.49.34
|
||||
with:
|
||||
tool: just
|
||||
|
||||
|
|
|
@ -18,12 +18,12 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
with:
|
||||
components: llvm-tools-preview
|
||||
|
||||
- name: Install cargo-llvm-cov
|
||||
uses: taiki-e/install-action@v2.44.71
|
||||
uses: taiki-e/install-action@v2.49.34
|
||||
with:
|
||||
tool: cargo-llvm-cov
|
||||
|
||||
|
@ -31,7 +31,7 @@ jobs:
|
|||
run: cargo llvm-cov --workspace --all-features --codecov --output-path codecov.json
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v5.0.2
|
||||
uses: codecov/codecov-action@v5.4.0
|
||||
with:
|
||||
files: codecov.json
|
||||
fail_ci_if_error: true
|
||||
|
|
|
@ -18,7 +18,7 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
with:
|
||||
toolchain: nightly
|
||||
components: rustfmt
|
||||
|
@ -35,7 +35,7 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
with: { components: clippy }
|
||||
|
||||
- uses: giraffate/clippy-action@v1.0.1
|
||||
|
@ -51,47 +51,19 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust (${{ vars.RUST_VERSION_EXTERNAL_TYPES }})
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
|
||||
with:
|
||||
toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }}
|
||||
|
||||
- name: Install just
|
||||
uses: taiki-e/install-action@v2.44.71
|
||||
uses: taiki-e/install-action@v2.49.34
|
||||
with:
|
||||
tool: just
|
||||
|
||||
- name: Install cargo-check-external-types
|
||||
uses: taiki-e/cache-cargo-install-action@v2.0.1
|
||||
uses: taiki-e/cache-cargo-install-action@v2.1.1
|
||||
with:
|
||||
tool: cargo-check-external-types
|
||||
|
||||
- name: check external types
|
||||
run: just check-external-types-all +${{ vars.RUST_VERSION_EXTERNAL_TYPES }}
|
||||
|
||||
public-api-diff:
|
||||
name: Public API Diff
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout main branch
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.base_ref }}
|
||||
|
||||
- name: Checkout PR branch
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust (${{ vars.RUST_VERSION_API_DIFF }})
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
|
||||
with:
|
||||
toolchain: ${{ vars.RUST_VERSION_API_DIFF }}
|
||||
|
||||
- name: Install cargo-public-api
|
||||
uses: taiki-e/install-action@v2.34.0
|
||||
with:
|
||||
tool: cargo-public-api
|
||||
|
||||
- name: Generate API diff
|
||||
run: |
|
||||
for f in $(find -mindepth 2 -maxdepth 2 -name Cargo.toml); do
|
||||
cargo public-api --manifest-path "$f" --simplified diff ${{ github.event.pull_request.base.sha }}..${{ github.sha }}
|
||||
done
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
Cargo.lock
|
||||
target/
|
||||
guide/build/
|
||||
/gh-pages
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
exclude = ["target/*"]
|
||||
include = ["**/*.toml"]
|
||||
|
||||
[formatting]
|
||||
column_width = 110
|
||||
|
||||
[[rule]]
|
||||
include = ["**/Cargo.toml"]
|
||||
keys = [
|
||||
"dependencies",
|
||||
"*-dependencies",
|
||||
"workspace.dependencies",
|
||||
"workspace.*-dependencies",
|
||||
"target.*.dependencies",
|
||||
"target.*.*-dependencies",
|
||||
]
|
||||
formatting.reorder_keys = true
|
||||
|
||||
[[rule]]
|
||||
include = ["**/Cargo.toml"]
|
||||
keys = [
|
||||
"dependencies.*",
|
||||
"*-dependencies.*",
|
||||
"workspace.dependencies.*",
|
||||
"workspace.*-dependencies.*",
|
||||
"target.*.dependencies",
|
||||
"target.*.*-dependencies",
|
||||
]
|
||||
formatting.reorder_keys = false
|
File diff suppressed because it is too large
Load Diff
|
@ -36,3 +36,9 @@ local-waker = { path = "local-waker" }
|
|||
lto = true
|
||||
opt-level = 3
|
||||
codegen-units = 1
|
||||
|
||||
[workspace.lints.rust]
|
||||
rust_2018_idioms = "deny"
|
||||
nonstandard-style = "deny"
|
||||
future_incompatible = "deny"
|
||||
missing_docs = { level = "warn", priority = -1 }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
> A collection of lower-level libraries for composable network services.
|
||||
|
||||
[](https://github.com/actix/actix-net/actions/workflows/ci.yml)
|
||||
[](https://codecov.io/gh/actix/actix-net)
|
||||
[](https://codecov.io/gh/actix/actix-net)
|
||||
[](https://discord.gg/NWpN5mmg3x)
|
||||
[](https://deps.rs/repo/github/actix/actix-net)
|
||||
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
[package]
|
||||
name = "actix-codec"
|
||||
version = "0.5.2"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
]
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>", "Rob Ede <robjtede@icloud.com>"]
|
||||
description = "Codec utilities for working with framed protocols"
|
||||
keywords = ["network", "framework", "async", "futures"]
|
||||
repository = "https://github.com/actix/actix-net"
|
||||
|
@ -14,13 +11,7 @@ edition.workspace = true
|
|||
rust-version.workspace = true
|
||||
|
||||
[package.metadata.cargo_check_external_types]
|
||||
allowed_external_types = [
|
||||
"bytes::*",
|
||||
"futures_core::*",
|
||||
"futures_sink::*",
|
||||
"tokio::*",
|
||||
"tokio_util::*",
|
||||
]
|
||||
allowed_external_types = ["bytes::*", "futures_core::*", "futures_sink::*", "tokio::*", "tokio_util::*"]
|
||||
|
||||
[dependencies]
|
||||
bitflags = "2"
|
||||
|
@ -40,3 +31,6 @@ tokio-test = "0.4.2"
|
|||
[[bench]]
|
||||
name = "lines"
|
||||
harness = false
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(missing_docs)]
|
||||
|
||||
use bytes::BytesMut;
|
||||
use criterion::{criterion_group, criterion_main, Criterion};
|
||||
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
//! [`Sink`]: futures_sink::Sink
|
||||
//! [`Stream`]: futures_core::Stream
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible, missing_docs)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(missing_docs)]
|
||||
|
||||
use std::{
|
||||
collections::VecDeque,
|
||||
io::{self, Write},
|
||||
|
|
|
@ -34,3 +34,6 @@ actix-rt = "2"
|
|||
futures-util = { version = "0.3.17", default-features = false }
|
||||
rustversion-msrv = "0.100"
|
||||
trybuild = "1"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
//! # Tests
|
||||
//! See docs for the [`#[test]`](macro@test) macro.
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(missing_docs)]
|
||||
|
||||
#[rustversion_msrv::msrv]
|
||||
#[test]
|
||||
fn compile_macros() {
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
[package]
|
||||
name = "actix-rt"
|
||||
version = "2.10.0"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
]
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>", "Rob Ede <robjtede@icloud.com>"]
|
||||
description = "Tokio-based single-threaded async runtime for the Actix ecosystem"
|
||||
keywords = ["async", "futures", "io", "runtime"]
|
||||
homepage = "https://actix.rs"
|
||||
|
@ -15,10 +12,7 @@ edition.workspace = true
|
|||
rust-version.workspace = true
|
||||
|
||||
[package.metadata.cargo_check_external_types]
|
||||
allowed_external_types = [
|
||||
"actix_macros::*",
|
||||
"tokio::*",
|
||||
]
|
||||
allowed_external_types = ["actix_macros::*", "tokio::*"]
|
||||
|
||||
[features]
|
||||
default = ["macros"]
|
||||
|
@ -37,3 +31,6 @@ tokio-uring = { version = "0.5", optional = true }
|
|||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1.23.1", features = ["full"] }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -41,8 +41,6 @@
|
|||
//! Note that there are currently some unimplemented parts of using `actix-rt` with `io-uring`.
|
||||
//! In particular, when running a `System`, only `System::block_on` is supported.
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible, missing_docs)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(missing_docs)]
|
||||
|
||||
use std::{
|
||||
future::Future,
|
||||
time::{Duration, Instant},
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
## 2.5.1
|
||||
|
||||
- Fix panic in test server.
|
||||
- Minimum supported Rust version (MSRV) is now 1.71.
|
||||
|
||||
## 2.5.0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "actix-server"
|
||||
version = "2.5.0"
|
||||
version = "2.5.1"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
|
@ -16,9 +16,7 @@ edition.workspace = true
|
|||
rust-version.workspace = true
|
||||
|
||||
[package.metadata.cargo_check_external_types]
|
||||
allowed_external_types = [
|
||||
"tokio::*",
|
||||
]
|
||||
allowed_external_types = ["tokio::*"]
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
@ -28,7 +26,6 @@ io-uring = ["tokio-uring", "actix-rt/io-uring"]
|
|||
actix-rt = { version = "2.10", default-features = false }
|
||||
actix-service = "2"
|
||||
actix-utils = "3"
|
||||
|
||||
futures-core = { version = "0.3.17", default-features = false, features = ["alloc"] }
|
||||
futures-util = { version = "0.3.17", default-features = false, features = ["alloc"] }
|
||||
mio = { version = "1", features = ["os-poll", "net"] }
|
||||
|
@ -45,6 +42,9 @@ actix-codec = "0.5"
|
|||
actix-rt = "2.8"
|
||||
|
||||
bytes = "1"
|
||||
pretty_env_logger = "0.5"
|
||||
futures-util = { version = "0.3.17", default-features = false, features = ["sink", "async-await-macro"] }
|
||||
pretty_env_logger = "0.5"
|
||||
tokio = { version = "1.23.1", features = ["io-util", "rt-multi-thread", "macros", "fs"] }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
<!-- prettier-ignore-start -->
|
||||
|
||||
[](https://crates.io/crates/actix-server)
|
||||
[](https://docs.rs/actix-server/2.5.0)
|
||||
[](https://docs.rs/actix-server/2.5.1)
|
||||
[](https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html)
|
||||

|
||||
<br />
|
||||
[](https://deps.rs/crate/actix-server/2.5.0)
|
||||
[](https://deps.rs/crate/actix-server/2.5.1)
|
||||

|
||||
[](https://discord.gg/NWpN5mmg3x)
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
//!
|
||||
//! Follow the prompt and enter a file path, relative or absolute.
|
||||
|
||||
#![allow(missing_docs)]
|
||||
|
||||
use std::io;
|
||||
|
||||
use actix_codec::{Framed, LinesCodec};
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! General purpose TCP server.
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
|
||||
|
|
|
@ -160,6 +160,7 @@ pub enum MioStream {
|
|||
|
||||
/// Helper trait for converting a Mio stream into a Tokio stream.
|
||||
pub trait FromStream: Sized {
|
||||
/// Creates stream from a `mio` stream.
|
||||
fn from_mio(sock: MioStream) -> io::Result<Self>;
|
||||
}
|
||||
|
||||
|
|
|
@ -123,7 +123,9 @@ impl TestServerHandle {
|
|||
|
||||
/// Connect to server, returning a Tokio `TcpStream`.
|
||||
pub fn connect(&self) -> io::Result<TcpStream> {
|
||||
TcpStream::from_std(net::TcpStream::connect(self.addr)?)
|
||||
let stream = net::TcpStream::connect(self.addr)?;
|
||||
stream.set_nonblocking(true)?;
|
||||
TcpStream::from_std(stream)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![allow(clippy::let_underscore_future)]
|
||||
#![allow(clippy::let_underscore_future, missing_docs)]
|
||||
|
||||
use std::{
|
||||
net,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(missing_docs)]
|
||||
|
||||
use std::net;
|
||||
|
||||
use actix_rt::net::TcpStream;
|
||||
|
@ -69,5 +71,7 @@ async fn new_with_builder() {
|
|||
srv.connect().unwrap();
|
||||
|
||||
// connect to alt service defined in custom ServerBuilder
|
||||
TcpStream::from_std(net::TcpStream::connect(alt_addr).unwrap()).unwrap();
|
||||
let stream = net::TcpStream::connect(alt_addr).unwrap();
|
||||
stream.set_nonblocking(true).unwrap();
|
||||
TcpStream::from_std(stream).unwrap();
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
## 2.0.3
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.71.
|
||||
|
||||
## 2.0.2
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
[package]
|
||||
name = "actix-service"
|
||||
version = "2.0.2"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
]
|
||||
version = "2.0.3"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>", "Rob Ede <robjtede@icloud.com>"]
|
||||
description = "Service trait and combinators for representing asynchronous request/response operations."
|
||||
keywords = ["network", "framework", "async", "futures", "service"]
|
||||
categories = ["network-programming", "asynchronous", "no-std"]
|
||||
|
@ -15,10 +12,12 @@ rust-version.workspace = true
|
|||
|
||||
[dependencies]
|
||||
futures-core = { version = "0.3.17", default-features = false }
|
||||
paste = "1"
|
||||
pin-project-lite = "0.2"
|
||||
|
||||
[dev-dependencies]
|
||||
actix-rt = "2"
|
||||
actix-utils = "3"
|
||||
futures-util = { version = "0.3.17", default-features = false }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
> Service trait and combinators for representing asynchronous request/response operations.
|
||||
|
||||
[](https://crates.io/crates/actix-service)
|
||||
[](https://docs.rs/actix-service/2.0.2)
|
||||
[](https://docs.rs/actix-service/2.0.3)
|
||||
[](https://blog.rust-lang.org/2020/03/12/Rust-1.46.html)
|
||||

|
||||
[](https://deps.rs/crate/actix-service/2.0.2)
|
||||
[](https://deps.rs/crate/actix-service/2.0.3)
|
||||

|
||||
[](https://discord.gg/NWpN5mmg3x)
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(missing_docs)]
|
||||
|
||||
use std::{future::Future, sync::mpsc, time::Duration};
|
||||
|
||||
async fn oracle<F, Fut>(f: F) -> (u32, u32)
|
||||
|
|
|
@ -3,36 +3,38 @@
|
|||
use alloc::{boxed::Box, rc::Rc};
|
||||
use core::{future::Future, pin::Pin};
|
||||
|
||||
use paste::paste;
|
||||
|
||||
use crate::{Service, ServiceFactory};
|
||||
|
||||
/// A boxed future with no send bound or lifetime parameters.
|
||||
pub type BoxFuture<T> = Pin<Box<dyn Future<Output = T>>>;
|
||||
|
||||
macro_rules! service_object {
|
||||
($name: ident, $type: tt, $fn_name: ident) => {
|
||||
paste! {
|
||||
#[doc = "Type alias for service trait object using `" $type "`."]
|
||||
pub type $name<Req, Res, Err> = $type<
|
||||
dyn Service<Req, Response = Res, Error = Err, Future = BoxFuture<Result<Res, Err>>>,
|
||||
>;
|
||||
/// Type alias for service trait object using [`Box`].
|
||||
pub type BoxService<Req, Res, Err> =
|
||||
Box<dyn Service<Req, Response = Res, Error = Err, Future = BoxFuture<Result<Res, Err>>>>;
|
||||
|
||||
#[doc = "Wraps service as a trait object using [`" $name "`]."]
|
||||
pub fn $fn_name<S, Req>(service: S) -> $name<Req, S::Response, S::Error>
|
||||
/// Wraps service as a trait object using [`BoxService`].
|
||||
pub fn service<S, Req>(service: S) -> BoxService<Req, S::Response, S::Error>
|
||||
where
|
||||
S: Service<Req> + 'static,
|
||||
Req: 'static,
|
||||
S::Future: 'static,
|
||||
{
|
||||
$type::new(ServiceWrapper::new(service))
|
||||
}
|
||||
}
|
||||
};
|
||||
Box::new(ServiceWrapper::new(service))
|
||||
}
|
||||
|
||||
service_object!(BoxService, Box, service);
|
||||
service_object!(RcService, Rc, rc_service);
|
||||
/// Type alias for service trait object using [`Rc`].
|
||||
pub type RcService<Req, Res, Err> =
|
||||
Rc<dyn Service<Req, Response = Res, Error = Err, Future = BoxFuture<Result<Res, Err>>>>;
|
||||
|
||||
/// Wraps service as a trait object using [`RcService`].
|
||||
pub fn rc_service<S, Req>(service: S) -> RcService<Req, S::Response, S::Error>
|
||||
where
|
||||
S: Service<Req> + 'static,
|
||||
Req: 'static,
|
||||
S::Future: 'static,
|
||||
{
|
||||
Rc::new(ServiceWrapper::new(service))
|
||||
}
|
||||
|
||||
struct ServiceWrapper<S> {
|
||||
inner: S,
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
//! See [`Service`] docs for information on this crate's foundational trait.
|
||||
|
||||
#![no_std]
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible, missing_docs)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
[package]
|
||||
name = "actix-tls"
|
||||
version = "3.4.0"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
]
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>", "Rob Ede <robjtede@icloud.com>"]
|
||||
description = "TLS acceptor and connector services for Actix ecosystem"
|
||||
keywords = ["network", "tls", "ssl", "async", "transport"]
|
||||
repository = "https://github.com/actix/actix-net.git"
|
||||
|
@ -18,12 +15,7 @@ all-features = true
|
|||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[package.metadata.cargo_check_external_types]
|
||||
allowed_external_types = [
|
||||
"actix_service::*",
|
||||
"actix_utils::*",
|
||||
"futures_core::*",
|
||||
"tokio::*",
|
||||
]
|
||||
allowed_external_types = ["actix_service::*", "actix_utils::*", "futures_core::*", "tokio::*"]
|
||||
|
||||
[package.metadata.cargo-machete]
|
||||
ignored = [
|
||||
|
@ -76,7 +68,6 @@ uri = ["dep:http-0_2", "dep:http-1"]
|
|||
actix-rt = { version = "2.2", default-features = false }
|
||||
actix-service = "2"
|
||||
actix-utils = "3"
|
||||
|
||||
futures-core = { version = "0.3.7", default-features = false, features = ["alloc"] }
|
||||
impl-more = "0.1"
|
||||
pin-project-lite = "0.2.7"
|
||||
|
@ -128,9 +119,9 @@ actix-codec = "0.5"
|
|||
actix-rt = "2.2"
|
||||
actix-server = "2"
|
||||
bytes = "1"
|
||||
pretty_env_logger = "0.5"
|
||||
futures-util = { version = "0.3.17", default-features = false, features = ["sink"] }
|
||||
itertools = "0.13"
|
||||
itertools = "0.14"
|
||||
pretty_env_logger = "0.5"
|
||||
rcgen = "0.13"
|
||||
rustls-pemfile = "2"
|
||||
tokio-rustls-026 = { package = "tokio-rustls", version = "0.26" }
|
||||
|
@ -139,3 +130,6 @@ trust-dns-resolver = "0.23"
|
|||
[[example]]
|
||||
name = "accept-rustls"
|
||||
required-features = ["accept", "rustls-0_23"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! TLS acceptor and connector services for the Actix ecosystem.
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible, missing_docs)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#![allow(missing_docs)]
|
||||
#![cfg(feature = "connect")]
|
||||
|
||||
use std::{
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#![allow(missing_docs)]
|
||||
#![cfg(feature = "connect")]
|
||||
|
||||
use std::{
|
||||
|
|
|
@ -13,20 +13,17 @@ edition.workspace = true
|
|||
rust-version.workspace = true
|
||||
|
||||
[package.metadata.cargo_check_external_types]
|
||||
allowed_external_types = [
|
||||
"actix_service::*",
|
||||
"actix_utils::*",
|
||||
"tracing::*",
|
||||
"tracing_futures::*",
|
||||
]
|
||||
allowed_external_types = ["actix_service::*", "actix_utils::*", "tracing::*", "tracing_futures::*"]
|
||||
|
||||
[dependencies]
|
||||
actix-service = "2"
|
||||
actix-utils = "3"
|
||||
|
||||
tracing = "0.1.35"
|
||||
tracing-futures = "0.2"
|
||||
|
||||
[dev-dependencies]
|
||||
actix-rt = "2"
|
||||
slab = "0.4"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! Actix tracing - support for tokio tracing with Actix services.
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
|
||||
|
@ -22,6 +20,7 @@ pub struct TracingService<S, F> {
|
|||
}
|
||||
|
||||
impl<S, F> TracingService<S, F> {
|
||||
/// Constructs new tracing middleware.
|
||||
pub fn new(inner: S, make_span: F) -> Self {
|
||||
TracingService { inner, make_span }
|
||||
}
|
||||
|
@ -63,6 +62,7 @@ pub struct TracingTransform<S, U, F> {
|
|||
}
|
||||
|
||||
impl<S, U, F> TracingTransform<S, U, F> {
|
||||
/// Constructs new tracing middleware.
|
||||
pub fn new(make_span: F) -> Self {
|
||||
TracingTransform {
|
||||
make_span,
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
[package]
|
||||
name = "actix-utils"
|
||||
version = "3.0.1"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
]
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>", "Rob Ede <robjtede@icloud.com>"]
|
||||
description = "Various utilities used in the Actix ecosystem"
|
||||
keywords = ["network", "framework", "async", "futures"]
|
||||
categories = ["network-programming", "asynchronous"]
|
||||
|
@ -14,10 +11,13 @@ edition.workspace = true
|
|||
rust-version.workspace = true
|
||||
|
||||
[dependencies]
|
||||
pin-project-lite = "0.2"
|
||||
local-waker = "0.1"
|
||||
pin-project-lite = "0.2"
|
||||
|
||||
[dev-dependencies]
|
||||
actix-rt = "2"
|
||||
futures-util = { version = "0.3.17", default-features = false }
|
||||
static_assertions = "1.1"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
//! Various utilities used in the Actix ecosystem.
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible, missing_docs)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
|
||||
|
|
|
@ -2,10 +2,7 @@
|
|||
name = "bytestring"
|
||||
version = "1.4.0"
|
||||
description = "A UTF-8 encoded read-only string using `Bytes` as storage"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
]
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>", "Rob Ede <robjtede@icloud.com>"]
|
||||
keywords = ["string", "bytes", "utf8", "web", "bytestring"]
|
||||
categories = ["no-std", "web-programming"]
|
||||
homepage = "https://actix.rs"
|
||||
|
@ -15,10 +12,7 @@ edition.workspace = true
|
|||
rust-version.workspace = true
|
||||
|
||||
[package.metadata.cargo_check_external_types]
|
||||
allowed_external_types = [
|
||||
"bytes::*",
|
||||
"serde::*",
|
||||
]
|
||||
allowed_external_types = ["bytes::*", "serde::*"]
|
||||
|
||||
[dependencies]
|
||||
bytes = { version = "1.2", default-features = false }
|
||||
|
@ -28,3 +22,6 @@ serde = { version = "1", optional = true }
|
|||
ahash = { version = "0.8", default-features = false }
|
||||
serde_json = "1"
|
||||
static_assertions = "1.1"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
//! See docs for [`ByteString`].
|
||||
|
||||
#![no_std]
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible, missing_docs)]
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
|
|
34
justfile
34
justfile
|
@ -18,10 +18,14 @@ fmt:
|
|||
fd --type=file --hidden -e=toml --exec-batch taplo format
|
||||
cargo +nightly fmt
|
||||
|
||||
# Downgrade dev-dependencies necessary to run MSRV checks/tests.
|
||||
# Downgrade dependencies necessary to run MSRV checks/tests.
|
||||
[private]
|
||||
downgrade-for-msrv:
|
||||
cargo update -p=clap --precise=4.4.18
|
||||
cargo update -p=clap --precise=4.4.18 # next ver: 1.74.0
|
||||
cargo update -p=native-tls --precise=0.2.13 # next ver: 1.80.0
|
||||
cargo update -p=litemap --precise=0.7.4 # next ver: 1.81.0
|
||||
cargo update -p=zerofrom --precise=0.1.5 # next ver: 1.81.0
|
||||
cargo update -p=half --precise=2.4.1 # next ver: 1.81.0
|
||||
|
||||
msrv := ```
|
||||
cargo metadata --format-version=1 \
|
||||
|
@ -42,21 +46,24 @@ all_crate_features := if os() == "linux" { "--all-features" } else { "--features
|
|||
clippy toolchain="":
|
||||
cargo {{ toolchain }} clippy --workspace --all-targets {{ all_crate_features }}
|
||||
|
||||
# Run Clippy using MSRV.
|
||||
clippy-msrv: downgrade-for-msrv (clippy msrv_rustup)
|
||||
|
||||
# Test workspace code.
|
||||
[macos]
|
||||
[windows]
|
||||
test toolchain="":
|
||||
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 {{ all_crate_features }}
|
||||
cargo {{ toolchain }} nextest run --no-tests=warn --workspace --exclude=actix-macros --no-default-features
|
||||
cargo {{ toolchain }} nextest run --no-tests=warn --workspace --exclude=actix-macros {{ all_crate_features }}
|
||||
|
||||
# Test workspace code.
|
||||
[linux]
|
||||
test toolchain="":
|
||||
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 {{ non_linux_all_features_list }}
|
||||
cargo {{ toolchain }} nextest run --workspace --exclude=actix-macros {{ all_crate_features }}
|
||||
cargo {{ toolchain }} nextest run --no-tests=warn --workspace --exclude=actix-macros --no-default-features
|
||||
cargo {{ toolchain }} nextest run --no-tests=warn --workspace --exclude=actix-macros {{ non_linux_all_features_list }}
|
||||
cargo {{ toolchain }} nextest run --no-tests=warn --workspace --exclude=actix-macros {{ all_crate_features }}
|
||||
|
||||
# Test workspace using MSRV.
|
||||
test-msrv: downgrade-for-msrv (test msrv_rustup)
|
||||
|
@ -69,9 +76,20 @@ test-docs toolchain="": && doc
|
|||
test-all toolchain="": (test toolchain) (test-docs toolchain)
|
||||
|
||||
# Document crates in workspace.
|
||||
doc *args:
|
||||
doc *args: && doc-set-workspace-crates
|
||||
rm -f "$(cargo metadata --format-version=1 | jq -r '.target_directory')/doc/crates.js"
|
||||
RUSTDOCFLAGS="--cfg=docsrs -Dwarnings" cargo +nightly doc --no-deps --workspace {{ all_crate_features }} {{ args }}
|
||||
|
||||
[private]
|
||||
doc-set-workspace-crates:
|
||||
#!/usr/bin/env bash
|
||||
(
|
||||
echo "window.ALL_CRATES ="
|
||||
cargo metadata --format-version=1 \
|
||||
| jq '[.packages[] | select(.source == null) | .targets | map(select(.doc) | .name)] | flatten'
|
||||
echo ";"
|
||||
) > "$(cargo metadata --format-version=1 | jq -r '.target_directory')/doc/crates.js"
|
||||
|
||||
# Document crates in workspace and watch for changes.
|
||||
doc-watch:
|
||||
@just doc --open
|
||||
|
|
|
@ -2,10 +2,7 @@
|
|||
name = "local-channel"
|
||||
version = "0.1.5"
|
||||
description = "A non-threadsafe multi-producer, single-consumer, futures-aware, FIFO queue"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
]
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>", "Rob Ede <robjtede@icloud.com>"]
|
||||
repository = "https://github.com/actix/actix-net"
|
||||
keywords = ["channel", "local", "futures"]
|
||||
license.workspace = true
|
||||
|
@ -13,10 +10,7 @@ edition.workspace = true
|
|||
rust-version.workspace = true
|
||||
|
||||
[package.metadata.cargo_check_external_types]
|
||||
allowed_external_types = [
|
||||
"futures_core::*",
|
||||
"futures_sink::*",
|
||||
]
|
||||
allowed_external_types = ["futures_core::*", "futures_sink::*"]
|
||||
|
||||
[dependencies]
|
||||
futures-core = "0.3.17"
|
||||
|
|
|
@ -2,10 +2,7 @@
|
|||
name = "local-waker"
|
||||
version = "0.1.4"
|
||||
description = "A synchronization primitive for thread-local task wakeup"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
]
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>", "Rob Ede <robjtede@icloud.com>"]
|
||||
repository = "https://github.com/actix/actix-net"
|
||||
keywords = ["waker", "local", "futures", "no-std"]
|
||||
categories = ["asynchronous", "no-std"]
|
||||
|
|
Loading…
Reference in New Issue