pub struct GroupResolver { /* private fields */ }Expand description
Manages named group sources with a default source.
Resolves group references like @group to node sets.
Implementations§
Source§impl GroupResolver
impl GroupResolver
Sourcepub fn add_source(
&mut self,
name: impl Into<String>,
source: Box<dyn GroupSource>,
)
pub fn add_source( &mut self, name: impl Into<String>, source: Box<dyn GroupSource>, )
Add a named source to the resolver.
Sourcepub fn set_default(&mut self, name: impl Into<String>)
pub fn set_default(&mut self, name: impl Into<String>)
Set the default source name.
Sourcepub fn group_nodes(
&self,
group: &str,
namespace: Option<&str>,
) -> Result<Vec<String>>
pub fn group_nodes( &self, group: &str, namespace: Option<&str>, ) -> Result<Vec<String>>
Resolve a group to a list of nodes.
If namespace is Some, uses that source; otherwise uses the default.
Sourcepub fn all_nodes(&self, namespace: Option<&str>) -> Result<Vec<String>>
pub fn all_nodes(&self, namespace: Option<&str>) -> Result<Vec<String>>
Get all nodes from all groups in the specified namespace.
Sourcepub fn grouplist(&self, namespace: Option<&str>) -> Result<Vec<String>>
pub fn grouplist(&self, namespace: Option<&str>) -> Result<Vec<String>>
List all group names in the specified namespace.
Sourcepub fn node_groups(
&self,
node: &str,
namespace: Option<&str>,
) -> Result<Vec<String>>
pub fn node_groups( &self, node: &str, namespace: Option<&str>, ) -> Result<Vec<String>>
Find all groups containing a given node.
Sourcepub fn has_node_groups(&self, namespace: Option<&str>) -> bool
pub fn has_node_groups(&self, namespace: Option<&str>) -> bool
Check if the namespace supports node group lookups.
Sourcepub fn set_illegal_chars(&mut self, chars: HashSet<char>)
pub fn set_illegal_chars(&mut self, chars: HashSet<char>)
Set illegal characters for group names.
Sourcepub fn is_valid_group_name(&self, name: &str) -> Result<()>
pub fn is_valid_group_name(&self, name: &str) -> Result<()>
Check if a group name contains illegal characters.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for GroupResolver
impl !UnwindSafe for GroupResolver
impl Freeze for GroupResolver
impl Send for GroupResolver
impl Sync for GroupResolver
impl Unpin for GroupResolver
impl UnsafeUnpin for GroupResolver
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