pub async fn execute<Cont, ContFut>(
        self,
        container: Input,
        cont: Cont,
    ) -> ControlFlow<Output, Input>
    where
        Input: Send + Sync + 'a,
        Cont: Fn(Intermediate) -> ContFut + Send + Sync + 'a,
        ContFut: Future<Output = ControlFlow<Output, Intermediate>> + Send + 'a,
    {
        (self.0)(container, Box::new(move |event| Box::pin(cont(event)))).await
    }
/// Executes this handler with a continuation.
///
/// Usually, you do not want to call this method by yourself, if you do not
/// write your own handler implementation. If you wish to execute handler
/// without a continuation, take a look at the [`Handler::dispatch`] method.
///
/// # Examples
///
/// ```
/// # #[tokio::main]
/// # async fn main() {
/// use dptree::prelude::*;
///
/// let handler = dptree::filter(|x: i32| async move { x > 0 });
///
/// let output = handler.execute(dptree::deps![10], |_| async { ControlFlow::Break("done") }).await;
/// assert_eq!(output, ControlFlow::Break("done"));
///
/// # }
/// ```
Executes this handler with a continuation.
Usually, you do not want to call this method by yourself, if you do not
write your own handler implementation. If you wish to execute handler
without a continuation, take a look at the [`Handler::dispatch`] method.
Executes this handler with a continuation . Usually you do not want to call this method by yourself if you do not write your own handler implementation . If you wish to execute handler without a continuation take a look at the [ ` Handler :: dispatch ` ] method .
pub async fn execute<Cont, ContFut>(
        self,
        container: Input,
        cont: Cont,
    ) -> ControlFlow<Output, Input>
    where
        Input: Send + Sync + 'a,
        Cont: Fn(Intermediate) -> ContFut + Send + Sync + 'a,
        ContFut: Future<Output = ControlFlow<Output, Intermediate>> + Send + 'a,
    {
        (self.0)(container, Box::new(move |event| Box::pin(cont(event)))).await
    }
pub async fn execute < Cont , ContFut > ( self , container : Input , cont : Cont , ) -> ControlFlow < Output , Input > where Input : Send + Sync + ' a , Cont : Fn ( Intermediate ) -> ContFut + Send + Sync + ' a , ContFut : Future < Output = ControlFlow < Output , Intermediate > > + Send + ' a , { ( self . 0 ) ( container , Box :: new ( move | event | Box :: pin ( cont ( event ) ) ) ) . await }
Executes this handler with a continuation.
Executes this handler with a continuation .
self
container
Input
cont
Cont
self
container
Input
cont
Cont
examples
None
#[tokio::main]
None
async fn main() {
use dptree::prelude::*.

let handler = dptree::filter(|x: i32| async move { x > 0 }).

let output = handler.execute(dptree::deps![10], |_| async { ControlFlow::Break("done") }).await;
assert_eq!(output, ControlFlow::Break("done")).
use dptree :: prelude :: * . let handler = dptree :: filter ( |x : i32| async move { x > 0 } ) . let output = handler . execute ( dptree :: deps! [ 10 ] |_| async { ControlFlow :: Break ( " done " ) } ) . await ; assert_eq! ( output ControlFlow :: Break ( " done " )) .
}
None