mirror of
https://github.com/fafhrd91/actix-net
synced 2025-08-16 12:39:00 +02:00
Compare commits
14 Commits
proxy-prot
...
local-wake
Author | SHA1 | Date | |
---|---|---|---|
|
61b6e01b02 | ||
|
392e591820 | ||
|
87440e5734 | ||
|
665dec456f | ||
|
7d138f0c31 | ||
|
3cd5d8b07a | ||
|
09548c96b0 | ||
|
17fd135349 | ||
|
b9b628c47b | ||
|
580af3dec4 | ||
|
db54639f0f | ||
|
6d9eb7e162 | ||
|
69e50b5e66 | ||
|
17409cd203 |
10
.github/dependabot.yml
vendored
Normal file
10
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: github-actions
|
||||
directory: /
|
||||
schedule:
|
||||
interval: weekly
|
||||
- package-ecosystem: cargo
|
||||
directory: /
|
||||
schedule:
|
||||
interval: weekly
|
24
.github/workflows/ci-post-merge.yml
vendored
24
.github/workflows/ci-post-merge.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
||||
if: matrix.target.os == 'macos-latest'
|
||||
run: sudo ifconfig lo0 alias 127.0.0.3
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Free Disk Space
|
||||
if: matrix.target.os == 'ubuntu-latest'
|
||||
@@ -52,12 +52,13 @@ jobs:
|
||||
echo 'OPENSSL_DIR=C:\Program Files\OpenSSL' | Out-File -FilePath $env:GITHUB_ENV -Append
|
||||
|
||||
- name: Install Rust (${{ matrix.version }})
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
|
||||
with:
|
||||
toolchain: ${{ matrix.version }}
|
||||
|
||||
- uses: taiki-e/install-action@v2
|
||||
with: { tool: cargo-hack }
|
||||
- uses: taiki-e/install-action@v2.21.2
|
||||
with:
|
||||
tool: cargo-hack
|
||||
|
||||
- name: check lib
|
||||
if: >
|
||||
@@ -107,15 +108,15 @@ jobs:
|
||||
name: minimal versions
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust (nightly)
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
|
||||
with:
|
||||
toolchain: nightly
|
||||
|
||||
- name: Install cargo-hack & cargo-minimal-versions
|
||||
uses: taiki-e/install-action@v1
|
||||
uses: taiki-e/install-action@v2.21.2
|
||||
with:
|
||||
tool: cargo-hack,cargo-minimal-versions
|
||||
|
||||
@@ -126,14 +127,15 @@ jobs:
|
||||
name: nextest
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
|
||||
|
||||
- name: Install cargo-nextest
|
||||
uses: taiki-e/install-action@v1
|
||||
with: { tool: cargo-nextest }
|
||||
uses: taiki-e/install-action@v2.21.2
|
||||
with:
|
||||
tool: cargo-nextest
|
||||
|
||||
- name: Test with cargo-nextest
|
||||
run: cargo nextest run
|
||||
|
39
.github/workflows/ci.yml
vendored
39
.github/workflows/ci.yml
vendored
@@ -24,10 +24,10 @@ jobs:
|
||||
- { name: Windows (MinGW), os: windows-latest, triple: x86_64-pc-windows-gnu }
|
||||
- { name: Windows (32-bit), os: windows-latest, triple: i686-pc-windows-msvc }
|
||||
version:
|
||||
- 1.65.0 # MSRV
|
||||
- stable
|
||||
- { name: msrv, version: 1.65.0 }
|
||||
- { name: stable, version: stable }
|
||||
|
||||
name: ${{ matrix.target.name }} / ${{ matrix.version }}
|
||||
name: ${{ matrix.target.name }} / ${{ matrix.version.name }}
|
||||
runs-on: ${{ matrix.target.os }}
|
||||
|
||||
env: {}
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
if: matrix.target.os == 'macos-latest'
|
||||
run: sudo ifconfig lo0 alias 127.0.0.3
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Free Disk Space
|
||||
if: matrix.target.os == 'ubuntu-latest'
|
||||
@@ -52,21 +52,25 @@ jobs:
|
||||
echo 'OPENSSL_DIR=C:\Program Files\OpenSSL-Win64' | Out-File -FilePath $env:GITHUB_ENV -Append
|
||||
echo 'OPENSSL_DIR=C:\Program Files\OpenSSL' | Out-File -FilePath $env:GITHUB_ENV -Append
|
||||
|
||||
- name: Install Rust (${{ matrix.version }})
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
- name: Install Rust (${{ matrix.version.name }})
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
|
||||
with:
|
||||
toolchain: ${{ matrix.version }}
|
||||
toolchain: ${{ matrix.version.version }}
|
||||
|
||||
- uses: taiki-e/install-action@v1
|
||||
with: { tool: cargo-hack }
|
||||
- uses: taiki-e/install-action@v2.21.2
|
||||
with:
|
||||
tool: cargo-hack
|
||||
|
||||
- name: Generate Cargo.lock
|
||||
run: cargo generate-lockfile
|
||||
|
||||
- name: workaround MSRV issues
|
||||
if: matrix.version != 'stable'
|
||||
if: matrix.version.name == 'msrv'
|
||||
run: |
|
||||
cargo update -p=time --precise=0.3.16 # time is only a dev dep so shouldn't affect msrv
|
||||
cargo update -p=time --precise=0.3.16
|
||||
cargo update -p=clap --precise=4.3.24
|
||||
cargo update -p=clap_lex --precise=0.5.0
|
||||
cargo update -p=anstyle --precise=1.0.2
|
||||
|
||||
- name: check lib
|
||||
if: >
|
||||
@@ -105,9 +109,9 @@ jobs:
|
||||
ulimit -Sl 512
|
||||
&& ulimit -Hl 512
|
||||
&& PATH=$PATH:/usr/share/rust/.cargo/bin
|
||||
&& RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test-rustls-020
|
||||
&& RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test-rustls-021
|
||||
&& RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test-linux
|
||||
&& RUSTUP_TOOLCHAIN=${{ matrix.version.version }} cargo ci-test-rustls-020
|
||||
&& RUSTUP_TOOLCHAIN=${{ matrix.version.version }} cargo ci-test-rustls-021
|
||||
&& RUSTUP_TOOLCHAIN=${{ matrix.version.version }} cargo ci-test-linux
|
||||
"
|
||||
|
||||
- name: Clear the cargo caches
|
||||
@@ -120,11 +124,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust (nightly)
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with: { toolchain: nightly }
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
|
||||
with:
|
||||
toolchain: nightly
|
||||
|
||||
- name: doc tests io-uring
|
||||
run: |
|
||||
|
12
.github/workflows/clippy-fmt.yml
vendored
12
.github/workflows/clippy-fmt.yml
vendored
@@ -14,9 +14,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
|
||||
with:
|
||||
toolchain: nightly
|
||||
components: rustfmt
|
||||
@@ -31,13 +31,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
|
||||
with: { components: clippy }
|
||||
|
||||
- uses: giraffate/clippy-action@v1
|
||||
- uses: giraffate/clippy-action@v1.0.1
|
||||
with:
|
||||
reporter: 'github-pr-check'
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
clippy_flags: --workspace --all-features --tests --examples --bins -- -Dclippy::todo
|
||||
clippy_flags: --workspace --all-features --tests --examples --bins -- -Dclippy::todo -Aunknown_lints
|
||||
|
2
.github/workflows/coverage.yml
vendored
2
.github/workflows/coverage.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
components: llvm-tools-preview
|
||||
|
||||
- name: Install cargo-llvm-cov
|
||||
uses: taiki-e/install-action@v2.18.9
|
||||
uses: taiki-e/install-action@v2.21.2
|
||||
with:
|
||||
tool: cargo-llvm-cov
|
||||
|
||||
|
7
.github/workflows/upload-doc.yml
vendored
7
.github/workflows/upload-doc.yml
vendored
@@ -18,9 +18,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
|
||||
with: { toolchain: nightly }
|
||||
|
||||
- name: Build Docs
|
||||
@@ -30,6 +30,7 @@ jobs:
|
||||
run: echo '<meta http-equiv="refresh" content="0;url=actix_server/index.html">' > target/doc/index.html
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: JamesIves/github-pages-deploy-action@v4
|
||||
uses: JamesIves/github-pages-deploy-action@v4.4.3
|
||||
with:
|
||||
folder: target/doc
|
||||
single-commit: true
|
||||
|
@@ -25,7 +25,7 @@ tokio-util = { version = "0.7", features = ["codec", "io"] }
|
||||
tracing = { version = "0.1.30", default-features = false, features = ["log"] }
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = { version = "0.4", features = ["html_reports"] }
|
||||
criterion = { version = "0.5", features = ["html_reports"] }
|
||||
tokio-test = "0.4.2"
|
||||
|
||||
[[bench]]
|
||||
|
@@ -26,6 +26,7 @@ quote = "1"
|
||||
syn = { version = "2", features = ["full"] }
|
||||
|
||||
# minimal versions compat
|
||||
[target.'cfg(any())'.dependencies]
|
||||
proc-macro2 = "1.0.60"
|
||||
|
||||
[dev-dependencies]
|
||||
|
@@ -203,16 +203,20 @@ impl SystemRunner {
|
||||
.map_err(|err| io::Error::new(io::ErrorKind::Other, err))
|
||||
}
|
||||
|
||||
/// Retrieves a reference to the underlying Actix runtime associated with this SystemRunner instance.
|
||||
/// Retrieves a reference to the underlying [Actix runtime](crate::Runtime) associated with this
|
||||
/// `SystemRunner` instance.
|
||||
///
|
||||
/// The Actix runtime is responsible for managing the event loop for an Actix system and executing asynchronous tasks.
|
||||
/// This method provides access to the runtime, allowing direct interaction with its features.
|
||||
/// The Actix runtime is responsible for managing the event loop for an Actix system and
|
||||
/// executing asynchronous tasks. This method provides access to the runtime, allowing direct
|
||||
/// interaction with its features.
|
||||
///
|
||||
/// In a typical use case, you might need to share the same runtime between different
|
||||
/// parts of your project. For example, some components might require a [`actix_rt::Runtime`] to spawn tasks on
|
||||
/// the same runtime.
|
||||
/// parts of your project. For example, some components might require a [`Runtime`] to spawn
|
||||
/// tasks on the same runtime.
|
||||
///
|
||||
/// # Example
|
||||
/// Read more in the documentation for [`Runtime`].
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// let system_runner = actix_rt::System::new();
|
||||
@@ -221,19 +225,14 @@ impl SystemRunner {
|
||||
/// // Use the runtime to spawn an async task or perform other operations
|
||||
/// ```
|
||||
///
|
||||
/// Read more in the documentation for [`actix_rt::Runtime`]
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// An immutable reference to the [`actix_rt::Runtime`] instance associated with this
|
||||
/// [`actix_rt::SystemRunner`] instance.
|
||||
///
|
||||
/// # Note
|
||||
///
|
||||
/// While this method provides an immutable reference to the Actix runtime, which is safe to share across threads,
|
||||
/// be aware that spawning blocking tasks on the Actix runtime could potentially impact system performance.
|
||||
/// This is because the Actix runtime is responsible for driving the system,
|
||||
/// and blocking tasks could delay other tasks in the run loop.
|
||||
/// While this method provides an immutable reference to the Actix runtime, which is safe to
|
||||
/// share across threads, be aware that spawning blocking tasks on the Actix runtime could
|
||||
/// potentially impact system performance. This is because the Actix runtime is responsible for
|
||||
/// driving the system, and blocking tasks could delay other tasks in the run loop.
|
||||
///
|
||||
/// [`Runtime`]: crate::Runtime
|
||||
pub fn runtime(&self) -> &crate::runtime::Runtime {
|
||||
&self.rt
|
||||
}
|
||||
|
@@ -2,14 +2,20 @@
|
||||
|
||||
> General purpose TCP server built for the Actix ecosystem.
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
[](https://crates.io/crates/actix-server)
|
||||
[](https://docs.rs/actix-server/2.3.0)
|
||||
[](https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html)
|
||||

|
||||

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

|
||||
[](https://discord.gg/NWpN5mmg3x)
|
||||
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
## Resources
|
||||
|
||||
- [Library Documentation](https://docs.rs/actix-server)
|
||||
- [Examples](/actix-server/examples)
|
||||
|
@@ -2,7 +2,6 @@ use std::{io, num::NonZeroUsize, time::Duration};
|
||||
|
||||
use actix_rt::net::TcpStream;
|
||||
use tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender};
|
||||
use tracing::{info, trace};
|
||||
|
||||
use crate::{
|
||||
server::ServerCommand,
|
||||
@@ -14,7 +13,9 @@ use crate::{
|
||||
|
||||
/// Multipath TCP (MPTCP) preference.
|
||||
///
|
||||
/// Also see [`ServerBuilder::mptcp()`].
|
||||
/// Currently only useful on Linux.
|
||||
///
|
||||
#[cfg_attr(target_os = "linux", doc = "Also see [`ServerBuilder::mptcp()`].")]
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum MpTcp {
|
||||
/// MPTCP will not be used when binding sockets.
|
||||
@@ -69,19 +70,19 @@ impl ServerBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
/// Set number of workers to start.
|
||||
/// Sets number of workers to start.
|
||||
///
|
||||
/// See [`bind()`](Self::bind()) for more details on how worker count affects the number of
|
||||
/// server factory instantiations.
|
||||
///
|
||||
/// The default worker count is the determined by [`std::thread::available_parallelism()`]. See
|
||||
/// its documentation to determine what behavior you should expect when server is run.
|
||||
///
|
||||
/// `num` must be greater than 0.
|
||||
///
|
||||
/// The default worker count is the number of physical CPU cores available. If your benchmark
|
||||
/// testing indicates that simultaneous multi-threading is beneficial to your app, you can use
|
||||
/// the [`num_cpus`] crate to acquire the _logical_ core count instead.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// Panics if `num` is 0.
|
||||
///
|
||||
/// [`num_cpus`]: https://docs.rs/num_cpus
|
||||
pub fn workers(mut self, num: usize) -> Self {
|
||||
assert_ne!(num, 0, "workers must be greater than 0");
|
||||
self.threads = num;
|
||||
@@ -155,13 +156,15 @@ impl ServerBuilder {
|
||||
self.max_concurrent_connections(num)
|
||||
}
|
||||
|
||||
/// Stop Actix `System` after server shutdown.
|
||||
/// Sets flag to stop Actix `System` after server shutdown.
|
||||
///
|
||||
/// This has no effect when server is running in a Tokio-only runtime.
|
||||
pub fn system_exit(mut self) -> Self {
|
||||
self.exit = true;
|
||||
self
|
||||
}
|
||||
|
||||
/// Disable OS signal handling.
|
||||
/// Disables OS signal handling.
|
||||
pub fn disable_signals(mut self) -> Self {
|
||||
self.listen_os_signals = false;
|
||||
self
|
||||
@@ -179,25 +182,49 @@ impl ServerBuilder {
|
||||
self
|
||||
}
|
||||
|
||||
/// Add new service to the server.
|
||||
pub fn bind<F, U, N>(mut self, name: N, addr: U, factory: F) -> io::Result<Self>
|
||||
/// Adds new service to the server.
|
||||
///
|
||||
/// Note that, if a DNS lookup is required, resolving hostnames is a blocking operation.
|
||||
///
|
||||
/// # Worker Count
|
||||
///
|
||||
/// The `factory` will be instantiated multiple times in most scenarios. The number of
|
||||
/// instantiations is number of [`workers`](Self::workers()) × number of sockets resolved by
|
||||
/// `addrs`.
|
||||
///
|
||||
/// For example, if you've manually set [`workers`](Self::workers()) to 2, and use `127.0.0.1`
|
||||
/// as the bind `addrs`, then `factory` will be instantiated twice. However, using `localhost`
|
||||
/// as the bind `addrs` can often resolve to both `127.0.0.1` (IPv4) _and_ `::1` (IPv6), causing
|
||||
/// the `factory` to be instantiated 4 times (2 workers × 2 bind addresses).
|
||||
///
|
||||
/// Using a bind address of `0.0.0.0`, which signals to use all interfaces, may also multiple
|
||||
/// the number of instantiations in a similar way.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an `io::Error` if:
|
||||
/// - `addrs` cannot be resolved into one or more socket addresses;
|
||||
/// - all the resolved socket addresses are already bound.
|
||||
pub fn bind<F, U, N>(mut self, name: N, addrs: U, factory: F) -> io::Result<Self>
|
||||
where
|
||||
F: ServerServiceFactory<TcpStream>,
|
||||
U: ToSocketAddrs,
|
||||
N: AsRef<str>,
|
||||
{
|
||||
let sockets = bind_addr(addr, self.backlog, &self.mptcp)?;
|
||||
let sockets = bind_addr(addrs, self.backlog, &self.mptcp)?;
|
||||
|
||||
trace!("binding server to: {:?}", &sockets);
|
||||
tracing::trace!("binding server to: {sockets:?}");
|
||||
|
||||
for lst in sockets {
|
||||
let token = self.next_token();
|
||||
|
||||
self.factories.push(StreamNewService::create(
|
||||
name.as_ref().to_string(),
|
||||
token,
|
||||
factory.clone(),
|
||||
lst.local_addr()?,
|
||||
));
|
||||
|
||||
self.sockets
|
||||
.push((token, name.as_ref().to_string(), MioListener::Tcp(lst)));
|
||||
}
|
||||
@@ -205,7 +232,12 @@ impl ServerBuilder {
|
||||
Ok(self)
|
||||
}
|
||||
|
||||
/// Add new service to the server.
|
||||
/// Adds service to the server using a socket listener already bound.
|
||||
///
|
||||
/// # Worker Count
|
||||
///
|
||||
/// The `factory` will be instantiated multiple times in most scenarios. The number of
|
||||
/// instantiations is: number of [`workers`](Self::workers()).
|
||||
pub fn listen<F, N: AsRef<str>>(
|
||||
mut self,
|
||||
name: N,
|
||||
@@ -237,7 +269,7 @@ impl ServerBuilder {
|
||||
if self.sockets.is_empty() {
|
||||
panic!("Server should have at least one bound socket");
|
||||
} else {
|
||||
info!("starting {} workers", self.threads);
|
||||
tracing::info!("starting {} workers", self.threads);
|
||||
Server::new(self)
|
||||
}
|
||||
}
|
||||
@@ -251,7 +283,12 @@ impl ServerBuilder {
|
||||
|
||||
#[cfg(unix)]
|
||||
impl ServerBuilder {
|
||||
/// Add new unix domain service to the server.
|
||||
/// Adds new service to the server using a UDS (unix domain socket) address.
|
||||
///
|
||||
/// # Worker Count
|
||||
///
|
||||
/// The `factory` will be instantiated multiple times in most scenarios. The number of
|
||||
/// instantiations is: number of [`workers`](Self::workers()).
|
||||
pub fn bind_uds<F, U, N>(self, name: N, addr: U, factory: F) -> io::Result<Self>
|
||||
where
|
||||
F: ServerServiceFactory<actix_rt::net::UnixStream>,
|
||||
@@ -271,9 +308,14 @@ impl ServerBuilder {
|
||||
self.listen_uds(name, lst, factory)
|
||||
}
|
||||
|
||||
/// Add new unix domain service to the server.
|
||||
/// Adds new service to the server using a UDS (unix domain socket) listener already bound.
|
||||
///
|
||||
/// Useful when running as a systemd service and a socket FD is acquired externally.
|
||||
///
|
||||
/// # Worker Count
|
||||
///
|
||||
/// The `factory` will be instantiated multiple times in most scenarios. The number of
|
||||
/// instantiations is: number of [`workers`](Self::workers()).
|
||||
pub fn listen_uds<F, N: AsRef<str>>(
|
||||
mut self,
|
||||
name: N,
|
||||
@@ -284,17 +326,22 @@ impl ServerBuilder {
|
||||
F: ServerServiceFactory<actix_rt::net::UnixStream>,
|
||||
{
|
||||
use std::net::{IpAddr, Ipv4Addr};
|
||||
|
||||
lst.set_nonblocking(true)?;
|
||||
|
||||
let token = self.next_token();
|
||||
let addr = crate::socket::StdSocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
|
||||
|
||||
self.factories.push(StreamNewService::create(
|
||||
name.as_ref().to_string(),
|
||||
token,
|
||||
factory,
|
||||
addr,
|
||||
));
|
||||
|
||||
self.sockets
|
||||
.push((token, name.as_ref().to_string(), MioListener::from(lst)));
|
||||
|
||||
Ok(self)
|
||||
}
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
[](https://crates.io/crates/actix-service)
|
||||
[](https://docs.rs/actix-service/2.0.2)
|
||||
[](https://blog.rust-lang.org/2020/03/12/Rust-1.46.html)
|
||||

|
||||

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

|
||||
[](https://discord.gg/NWpN5mmg3x)
|
||||
|
@@ -2,6 +2,10 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
## 1.3.1
|
||||
|
||||
- No significant changes since `1.3.0`.
|
||||
|
||||
## 1.3.0
|
||||
|
||||
- Implement `AsRef<ByteString>` for `ByteString`.
|
||||
|
@@ -1,11 +1,11 @@
|
||||
[package]
|
||||
name = "bytestring"
|
||||
version = "1.3.0"
|
||||
version = "1.3.1"
|
||||
description = "A UTF-8 encoded read-only string using `Bytes` as storage"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
]
|
||||
description = "An immutable UTF-8 encoded string using Bytes as storage"
|
||||
keywords = ["string", "bytes", "utf8", "web", "actix"]
|
||||
categories = ["no-std", "web-programming"]
|
||||
homepage = "https://actix.rs"
|
||||
|
16
bytestring/README.md
Normal file
16
bytestring/README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# `bytestring`
|
||||
|
||||
> A UTF-8 encoded read-only string using `Bytes` as storage.
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
[](https://crates.io/crates/bytestring)
|
||||
[](https://docs.rs/bytestring/1.3.1)
|
||||
[](https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html)
|
||||

|
||||
<br />
|
||||
[](https://deps.rs/crate/bytestring/1.3.1)
|
||||

|
||||
[](https://discord.gg/NWpN5mmg3x)
|
||||
|
||||
<!-- prettier-ignore-end -->
|
@@ -1,4 +1,6 @@
|
||||
//! A UTF-8 encoded read-only string using Bytes as storage.
|
||||
//! A UTF-8 encoded read-only string using `Bytes` as storage.
|
||||
//!
|
||||
//! See docs for [`ByteString`].
|
||||
|
||||
#![no_std]
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
|
11
justfile
Normal file
11
justfile
Normal file
@@ -0,0 +1,11 @@
|
||||
_list:
|
||||
@just --list
|
||||
|
||||
# Document crates in workspace.
|
||||
doc:
|
||||
RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --no-deps --workspace --features=rustls,openssl
|
||||
|
||||
# Document crates in workspace and watch for changes.
|
||||
doc-watch:
|
||||
RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --no-deps --workspace --features=rustls,openssl --open
|
||||
cargo watch -- RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --no-deps --workspace --features=rustls,openssl
|
@@ -2,6 +2,10 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
## 0.1.5
|
||||
|
||||
- No significant changes since `0.1.4`.
|
||||
|
||||
## 0.1.4
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.65.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "local-channel"
|
||||
version = "0.1.4"
|
||||
version = "0.1.5"
|
||||
description = "A non-threadsafe multi-producer, single-consumer, futures-aware, FIFO queue"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
|
16
local-channel/README.md
Normal file
16
local-channel/README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# `local-channel`
|
||||
|
||||
> A non-threadsafe multi-producer, single-consumer, futures-aware, FIFO queue.
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
[](https://crates.io/crates/local-channel)
|
||||
[](https://docs.rs/local-channel/0.1.5)
|
||||
[](https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html)
|
||||

|
||||
<br />
|
||||
[](https://deps.rs/crate/local-channel/0.1.5)
|
||||

|
||||
[](https://discord.gg/NWpN5mmg3x)
|
||||
|
||||
<!-- prettier-ignore-end -->
|
@@ -1,4 +1,6 @@
|
||||
//! Non-thread-safe channels.
|
||||
//!
|
||||
//! See docs for [`mpsc::channel()`].
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![warn(future_incompatible, missing_docs)]
|
||||
|
@@ -2,6 +2,8 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
## 0.1.4
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.65.
|
||||
|
||||
## 0.1.3
|
||||
|
@@ -1,15 +1,15 @@
|
||||
[package]
|
||||
name = "local-waker"
|
||||
version = "0.1.3"
|
||||
version = "0.1.4"
|
||||
description = "A synchronization primitive for thread-local task wakeup"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
]
|
||||
repository = "https://github.com/actix/actix-net.git"
|
||||
repository = "https://github.com/actix/actix-net"
|
||||
keywords = ["waker", "local", "futures", "no-std"]
|
||||
categories = ["asynchronous", "no-std"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
license.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
|
||||
|
16
local-waker/README.md
Normal file
16
local-waker/README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# `local-waker`
|
||||
|
||||
> A synchronization primitive for thread-local task wakeup.
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
[](https://crates.io/crates/local-waker)
|
||||
[](https://docs.rs/local-waker/0.1.4)
|
||||
[](https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html)
|
||||

|
||||
<br />
|
||||
[](https://deps.rs/crate/local-waker/0.1.4)
|
||||

|
||||
[](https://discord.gg/NWpN5mmg3x)
|
||||
|
||||
<!-- prettier-ignore-end -->
|
Reference in New Issue
Block a user