pub enum DenialBehavior {
NotFound,
Unauthorized,
Custom(Arc<dyn Fn(&str) -> Error + Send + Sync>),
}Expand description
Behavior when a filtered capability is accessed directly.
Variants§
NotFound
Return “method not found” error – hides the capability entirely.
This is the default and recommended for security. Use this in multi-tenant scenarios where tools should not be discoverable by unauthorized users.
Return an “unauthorized” error, revealing the capability exists.
Use this when the client should know about the capability but is not permitted to invoke it (e.g., premium features behind an upgrade prompt).
Custom(Arc<dyn Fn(&str) -> Error + Send + Sync>)
Use a custom error generator for application-specific responses.
Use this when you need custom status codes, domain-specific error messages, or structured error payloads.
Implementations§
Trait Implementations§
Source§impl Clone for DenialBehavior
impl Clone for DenialBehavior
Source§fn clone(&self) -> DenialBehavior
fn clone(&self) -> DenialBehavior
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DenialBehavior
impl Debug for DenialBehavior
Source§impl Default for DenialBehavior
impl Default for DenialBehavior
Source§fn default() -> DenialBehavior
fn default() -> DenialBehavior
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DenialBehavior
impl !RefUnwindSafe for DenialBehavior
impl Send for DenialBehavior
impl Sync for DenialBehavior
impl Unpin for DenialBehavior
impl !UnwindSafe for DenialBehavior
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