Skip to main content

GroupSource

Trait GroupSource 

Source
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§

Source

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§

Source

fn resolve_all(&self) -> Result<String>

Get all nodes from all groups.

Returns a comma-separated list of all nodes.

Source

fn resolve_list(&self) -> Result<Vec<String>>

List all available group names.

Source

fn resolve_reverse(&self, _node: &str) -> Result<Vec<String>>

Find all groups that contain a given node.

Source

fn has_reverse(&self) -> bool

Returns true if this source supports reverse lookups.

Source

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".

Implementors§