Trait Helper

Source
pub trait Helper {
    // Required methods
    fn apply_ruleset_raw<'a, P: AsRef<OsStr> + Sync + ?Sized, A: AsRef<OsStr> + Sync + ?Sized + 'a, I: IntoIterator<Item = &'a A> + Send>(
        payload: String,
        program: Option<&P>,
        args: I,
    ) -> impl Future<Output = Result<(), NftablesError>> + Send;
    fn get_current_ruleset_raw<'a, P: AsRef<OsStr> + Sync + ?Sized, A: AsRef<OsStr> + Sync + ?Sized + 'a, I: IntoIterator<Item = &'a A> + Send>(
        program: Option<&P>,
        args: I,
    ) -> impl Future<Output = Result<String, NftablesError>> + Send;

    // Provided methods
    fn apply_ruleset(
        nftables: &Nftables<'_>,
    ) -> impl Future<Output = Result<(), NftablesError>> + Send { ... }
    fn apply_ruleset_with_args<'a, P: AsRef<OsStr> + Sync + ?Sized, A: AsRef<OsStr> + Sync + ?Sized + 'a, I: IntoIterator<Item = &'a A> + Send>(
        nftables: &Nftables<'_>,
        program: Option<&P>,
        args: I,
    ) -> impl Future<Output = Result<(), NftablesError>> + Send { ... }
    fn get_current_ruleset(    ) -> impl Future<Output = Result<Nftables<'static>, NftablesError>> + Send { ... }
    fn get_current_ruleset_with_args<'a, P: AsRef<OsStr> + Sync + ?Sized, A: AsRef<OsStr> + Sync + ?Sized + 'a, I: IntoIterator<Item = &'a A> + Send>(
        program: Option<&P>,
        args: I,
    ) -> impl Future<Output = Result<Nftables<'static>, NftablesError>> + Send { ... }
}
Expand description

A helper that provides asynchronous “nft” invocations with nftables-crate types, backed by a Driver. As such, the Helper trait is implemented for every Driver.

Required Methods§

Source

fn apply_ruleset_raw<'a, P: AsRef<OsStr> + Sync + ?Sized, A: AsRef<OsStr> + Sync + ?Sized + 'a, I: IntoIterator<Item = &'a A> + Send>( payload: String, program: Option<&P>, args: I, ) -> impl Future<Output = Result<(), NftablesError>> + Send

Apply a ruleset consisting of an untyped String payload with, optionally, a custom “nft” program and extra arguments.

Source

fn get_current_ruleset_raw<'a, P: AsRef<OsStr> + Sync + ?Sized, A: AsRef<OsStr> + Sync + ?Sized + 'a, I: IntoIterator<Item = &'a A> + Send>( program: Option<&P>, args: I, ) -> impl Future<Output = Result<String, NftablesError>> + Send

Get the current ruleset as an untyped String payload with, optionally, a custom “nft” program and extra arguments.

Provided Methods§

Source

fn apply_ruleset( nftables: &Nftables<'_>, ) -> impl Future<Output = Result<(), NftablesError>> + Send

Apply a Nftables ruleset.

Source

fn apply_ruleset_with_args<'a, P: AsRef<OsStr> + Sync + ?Sized, A: AsRef<OsStr> + Sync + ?Sized + 'a, I: IntoIterator<Item = &'a A> + Send>( nftables: &Nftables<'_>, program: Option<&P>, args: I, ) -> impl Future<Output = Result<(), NftablesError>> + Send

Apply a Nftables ruleset with, optionally, a custom “nft” program and extra arguments.

Source

fn get_current_ruleset() -> impl Future<Output = Result<Nftables<'static>, NftablesError>> + Send

Get the current Nftables ruleset.

Source

fn get_current_ruleset_with_args<'a, P: AsRef<OsStr> + Sync + ?Sized, A: AsRef<OsStr> + Sync + ?Sized + 'a, I: IntoIterator<Item = &'a A> + Send>( program: Option<&P>, args: I, ) -> impl Future<Output = Result<Nftables<'static>, NftablesError>> + Send

Get the current Nftables ruleset with, optionally, a custom “nft” program and extra arguments.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<D: Driver> Helper for D