#[non_exhaustive]pub enum HookOutcome {
Continue,
Deny(ErrorData),
Replace(Box<CallToolResult>),
}Expand description
Outcome returned by a BeforeHook to control invocation flow.
HookOutcome::Continue- proceed with the wrapped handler.HookOutcome::Deny- reject the call with the suppliedErrorData; the inner handler is not called.HookOutcome::Replace- return the supplied result instead of invoking the inner handler. The result is still subject tomax_result_bytescapping.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Continue
Proceed with the wrapped handler.
Deny(ErrorData)
Reject the call. The error is propagated to the client as-is.
Replace(Box<CallToolResult>)
Skip the inner handler and return the supplied result instead.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HookOutcome
impl RefUnwindSafe for HookOutcome
impl Send for HookOutcome
impl Sync for HookOutcome
impl Unpin for HookOutcome
impl UnsafeUnpin for HookOutcome
impl UnwindSafe for HookOutcome
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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