pub trait GroupSource: Send + Sync {
// Required method
fn resolve_map(&self, group: &str) -> Result<String>;
// Provided methods
fn resolve_all(&self) -> Result<String> { ... }
fn resolve_list(&self) -> Result<Vec<String>> { ... }
fn resolve_reverse(&self, _node: &str) -> Result<Vec<String>> { ... }
fn has_reverse(&self) -> bool { ... }
fn cache_time(&self) -> Option<f64> { ... }
}Expand description
A source of node group definitions.
Group sources can be backed by various backends: static in-memory data, shell scripts, configuration files, etc.
Required Methods§
Sourcefn resolve_map(&self, group: &str) -> Result<String>
fn resolve_map(&self, group: &str) -> Result<String>
Resolve a group name to a node pattern string.
Returns a comma-separated list of node names or a node pattern.
Provided Methods§
Sourcefn resolve_all(&self) -> Result<String>
fn resolve_all(&self) -> Result<String>
Get all nodes from all groups.
Returns a comma-separated list of all nodes.
Sourcefn resolve_list(&self) -> Result<Vec<String>>
fn resolve_list(&self) -> Result<Vec<String>>
List all available group names.
Sourcefn resolve_reverse(&self, _node: &str) -> Result<Vec<String>>
fn resolve_reverse(&self, _node: &str) -> Result<Vec<String>>
Find all groups that contain a given node.
Sourcefn has_reverse(&self) -> bool
fn has_reverse(&self) -> bool
Returns true if this source supports reverse lookups.
Sourcefn cache_time(&self) -> Option<f64>
fn cache_time(&self) -> Option<f64>
Returns the cache time in seconds, if any.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".