Skip to main content

GroupResolver

Struct GroupResolver 

Source
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

Source

pub fn new() -> Self

Create a new GroupResolver.

Source

pub fn add_source( &mut self, name: impl Into<String>, source: Box<dyn GroupSource>, )

Add a named source to the resolver.

Source

pub fn set_default(&mut self, name: impl Into<String>)

Set the default source name.

Source

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.

Source

pub fn all_nodes(&self, namespace: Option<&str>) -> Result<Vec<String>>

Get all nodes from all groups in the specified namespace.

Source

pub fn grouplist(&self, namespace: Option<&str>) -> Result<Vec<String>>

List all group names in the specified namespace.

Source

pub fn node_groups( &self, node: &str, namespace: Option<&str>, ) -> Result<Vec<String>>

Find all groups containing a given node.

Source

pub fn has_node_groups(&self, namespace: Option<&str>) -> bool

Check if the namespace supports node group lookups.

Source

pub fn set_illegal_chars(&mut self, chars: HashSet<char>)

Set illegal characters for group names.

Source

pub fn is_valid_group_name(&self, name: &str) -> Result<()>

Check if a group name contains illegal characters.

Trait Implementations§

Source§

impl Default for GroupResolver

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.