Struct AsyncProcessDriver

Source
pub struct AsyncProcessDriver;
Available on crate feature async-process only.
Expand description

A Driver implementation using the async-process crate for I/O.

Trait Implementations§

Source§

impl Driver for AsyncProcessDriver

Source§

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<D> Helper for D
where D: Driver,

Source§

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

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>
where P: AsRef<OsStr> + Sync + ?Sized, A: AsRef<OsStr> + Sync + 'a + ?Sized, I: IntoIterator<Item = &'a A> + Send,

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

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.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more