pub struct GatedHandler { /* private fields */ }Expand description
A SkillHandler that runs its gates on the inner handler’s output.
The inner handler runs first; its error is returned unchanged and no gate runs. On success the gates run in the order they were added, and the first error stops the rest and becomes the result. Register it like any other handler.
Implementations§
Source§impl GatedHandler
impl GatedHandler
pub fn new(skill_id: impl Into<String>, inner: Arc<dyn SkillHandler>) -> Self
Sourcepub fn gate(self, gate: Arc<dyn PreTerminalGate>) -> Self
pub fn gate(self, gate: Arc<dyn PreTerminalGate>) -> Self
Adds a gate after those already added.
Trait Implementations§
Source§impl SkillHandler for GatedHandler
impl SkillHandler for GatedHandler
Auto Trait Implementations§
impl !RefUnwindSafe for GatedHandler
impl !UnwindSafe for GatedHandler
impl Forget for GatedHandler
impl Freeze for GatedHandler
impl Move for GatedHandler
impl Send for GatedHandler
impl Sync for GatedHandler
impl Unpin for GatedHandler
impl UnsafeUnpin for GatedHandler
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