Crates.io | nftables-async |
lib.rs | nftables-async |
version | |
source | src |
created_at | 2024-10-27 05:50:16.018193+00 |
updated_at | 2025-03-23 13:51:56.035376+00 |
description | An async version of the helper to run nftables, providing full compatibility with the rest of the nftables crate |
homepage | |
repository | https://github.com/kanpov/nftables-async |
max_upload_size | |
id | 1424359 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
An async version of the helper to run nftables in the nftables
crate. Simply add both nftables-async
and nftables
to your crate, then use the nftables_async::apply_ruleset
or nftables_async::get_current_ruleset
to perform manipulations. Everything is compatible with the sync helper, even the error types, the functions, however, return "true" async futures.
To provide the asynchronous I/O, an implementation of the Process
trait in the crate is needed. Two implementations are provided built-in behind feature gates:
TokioProcess
using the Tokio stack, enabled via tokio-process
featureAsyncProcess
using the async-process
crate (Smol stack), enabled via async-process
feature.nftables 0.6.0
introduced tokio
and async-process
features that are mostly equivalent to this crate, however, these have some disadvantages that make nftables-async
still relevant:
nftables
is not implemented via a trait (like nftables_async::Process
), meaning third-party extensions for async platforms other than Tokio or the async-*
stack are not easily possible.nftables
that has both enabled. This breaks the use-case of fcnet
, that needs both when enabling multiple runtime features, and is generally inconvenient.