Trait carapax::dialogue::DialogueExt
source · pub trait DialogueExt<P, PI, HI, HS>: Sized {
// Provided method
fn with_dialogue<B>(
self,
predicate: P
) -> Predicate<DialoguePredicate<B, P, PI, HS>, HandlerInput, DialogueDecorator<B, Self, HI, HS>, HandlerInput> { ... }
}
Available on crate feature
dialogue
only.Expand description
Provides a shortcut for wrapping a Handler
by a DialogueDecorator
.
Provided Methods§
sourcefn with_dialogue<B>(
self,
predicate: P
) -> Predicate<DialoguePredicate<B, P, PI, HS>, HandlerInput, DialogueDecorator<B, Self, HI, HS>, HandlerInput>
fn with_dialogue<B>( self, predicate: P ) -> Predicate<DialoguePredicate<B, P, PI, HS>, HandlerInput, DialogueDecorator<B, Self, HI, HS>, HandlerInput>
Shortcut to wrap a Handler
with a DialogueDecorator
.
Example: handler.dialogue(predicate)
.
§Arguments
predicate
- A predicate to be execute before starting the dialogue.
If you don’t need to start the dialogue conditionally,
you can use DialogueDecorator::new
directly.
Object Safety§
This trait is not object safe.