pub struct TokioDriver;
Available on crate feature
tokio-process
only.Expand description
A Driver implementation using the tokio crate for I/O.
Trait Implementations§
Source§impl Driver for TokioDriver
impl Driver for TokioDriver
Source§async fn run_process(
program: &OsStr,
args: &[&OsStr],
stdin: Option<&[u8]>,
) -> Result<Output, Error>
async fn run_process( program: &OsStr, args: &[&OsStr], stdin: Option<&[u8]>, ) -> Result<Output, Error>
Run the provided program with the provided arguments and retrieve its output.
If stdin is None, stdin should be nulled by the driver and no interaction should occur with the process.
If stdin is Some, stdin should be piped and the byte payload as well as a subsequent EOF (closure of the pipe)
should be transmitted before the process is waited on.
Auto Trait Implementations§
impl Freeze for TokioDriver
impl RefUnwindSafe for TokioDriver
impl Send for TokioDriver
impl Sync for TokioDriver
impl Unpin for TokioDriver
impl UnwindSafe for TokioDriver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<D> Helper for Dwhere
D: Driver,
impl<D> Helper for Dwhere
D: Driver,
Source§async fn apply_ruleset_raw<'a, P, A, I>(
payload: String,
program: Option<&P>,
args: I,
) -> Result<(), NftablesError>
async fn apply_ruleset_raw<'a, P, A, I>( payload: String, program: Option<&P>, args: I, ) -> Result<(), NftablesError>
Apply a ruleset consisting of an untyped String payload with, optionally, a custom “nft” program and
extra arguments.
Source§async fn get_current_ruleset_raw<'a, P, A, I>(
program: Option<&P>,
args: I,
) -> Result<String, NftablesError>
async fn get_current_ruleset_raw<'a, P, A, I>( program: Option<&P>, args: I, ) -> Result<String, NftablesError>
Get the current ruleset as an untyped String payload with, optionally, a custom “nft” program and
extra arguments.
Source§fn apply_ruleset(
nftables: &Nftables<'_>,
) -> impl Future<Output = Result<(), NftablesError>> + Send
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
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
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
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.