pub struct ToolFilter { /* private fields */ }Expand description
Filters tools at registration time using pattern-based allow/reject lists.
When both allowed and rejected match a tool name, rejected takes
precedence — the tool is excluded.
Implementations§
Source§impl ToolFilter
impl ToolFilter
Sourcepub fn with_allowed(self, patterns: Vec<ToolPattern>) -> Self
pub fn with_allowed(self, patterns: Vec<ToolPattern>) -> Self
Set the allowed patterns.
Sourcepub fn with_rejected(self, patterns: Vec<ToolPattern>) -> Self
pub fn with_rejected(self, patterns: Vec<ToolPattern>) -> Self
Set the rejected patterns.
Sourcepub fn is_allowed(&self, name: &str) -> bool
pub fn is_allowed(&self, name: &str) -> bool
Test whether a tool name passes through this filter.
Trait Implementations§
Source§impl Clone for ToolFilter
impl Clone for ToolFilter
Source§fn clone(&self) -> ToolFilter
fn clone(&self) -> ToolFilter
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 ToolFilter
impl Debug for ToolFilter
Source§impl Default for ToolFilter
impl Default for ToolFilter
Source§fn default() -> ToolFilter
fn default() -> ToolFilter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ToolFilter
impl RefUnwindSafe for ToolFilter
impl Send for ToolFilter
impl Sync for ToolFilter
impl Unpin for ToolFilter
impl UnsafeUnpin for ToolFilter
impl UnwindSafe for ToolFilter
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