pub struct McpProfile { /* private fields */ }Expand description
Allow/deny filter that decides which surface rows reach a client.
Names are matched with simple * glob patterns. A row is allowed when it
matches no deny pattern and either the allow set is empty or it matches an
allow pattern.
Implementations§
Source§impl McpProfile
impl McpProfile
Sourcepub fn allow_names<I, S>(names: I) -> Self
pub fn allow_names<I, S>(names: I) -> Self
Builds a profile whose allow set is names and whose deny set is empty.
Sourcepub fn deny_names<I, S>(names: I) -> Self
pub fn deny_names<I, S>(names: I) -> Self
Builds a profile whose deny set is names and whose allow set is empty.
Sourcepub fn with_allowed_name(self, name: impl Into<String>) -> Self
pub fn with_allowed_name(self, name: impl Into<String>) -> Self
Returns the profile with name added to the allow set.
Sourcepub fn with_denied_name(self, name: impl Into<String>) -> Self
pub fn with_denied_name(self, name: impl Into<String>) -> Self
Returns the profile with name added to the deny set.
Sourcepub fn allows_name(&self, name: &str) -> bool
pub fn allows_name(&self, name: &str) -> bool
Reports whether a row named name passes this profile.
Sourcepub fn allows(&self, row: &McpSurfaceCard) -> bool
pub fn allows(&self, row: &McpSurfaceCard) -> bool
Reports whether row passes this profile.
Trait Implementations§
Source§impl Clone for McpProfile
impl Clone for McpProfile
Source§fn clone(&self) -> McpProfile
fn clone(&self) -> McpProfile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 McpProfile
impl Debug for McpProfile
Source§impl Default for McpProfile
impl Default for McpProfile
Source§fn default() -> McpProfile
fn default() -> McpProfile
Returns the “default value” for a type. Read more
impl Eq for McpProfile
Source§impl PartialEq for McpProfile
impl PartialEq for McpProfile
Source§fn eq(&self, other: &McpProfile) -> bool
fn eq(&self, other: &McpProfile) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for McpProfile
Auto Trait Implementations§
impl Freeze for McpProfile
impl RefUnwindSafe for McpProfile
impl Send for McpProfile
impl Sync for McpProfile
impl Unpin for McpProfile
impl UnsafeUnpin for McpProfile
impl UnwindSafe for McpProfile
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