[][src]Trait splinter::node_registry::NodeRegistryReader

pub trait NodeRegistryReader: Send + Sync {
    fn list_nodes<'a, 'b: 'a>(
        &'b self,
        predicates: &'a [MetadataPredicate]
    ) -> Result<Box<dyn Iterator<Item = Node> + Send + 'a>, NodeRegistryError>;
fn count_nodes(
        &self,
        predicates: &[MetadataPredicate]
    ) -> Result<u32, NodeRegistryError>;
fn fetch_node(&self, identity: &str) -> Result<Node, NodeRegistryError>; fn has_node(&self, identity: &str) -> Result<bool, NodeRegistryError> { ... } }

Provides Node Registry read capabilities.

Required methods

fn list_nodes<'a, 'b: 'a>(
    &'b self,
    predicates: &'a [MetadataPredicate]
) -> Result<Box<dyn Iterator<Item = Node> + Send + 'a>, NodeRegistryError>

Returns an iterator over the nodes in the registry.

Arguments

  • predicates - A list of of predicates to be applied to the resulting list. These are applied as an AND, from a query perspective. If the list is empty, it is the equivalent of no predicates (i.e. return all).

fn count_nodes(
    &self,
    predicates: &[MetadataPredicate]
) -> Result<u32, NodeRegistryError>

Returns the count of nodes in the registry.

Arguments

  • predicates - A list of of predicates to be applied before counting the nodes. These are applied as an AND, from a query perspective. If the list is empty, it is the equivalent of no predicates (i.e. return all).

fn fetch_node(&self, identity: &str) -> Result<Node, NodeRegistryError>

Returns a node with the given identity.

Arguments

  • identity - The Splinter identity of the node.
Loading content...

Provided methods

fn has_node(&self, identity: &str) -> Result<bool, NodeRegistryError>

Loading content...

Implementations on Foreign Types

impl<NR: ?Sized> NodeRegistryReader for Box<NR> where
    NR: NodeRegistryReader
[src]

Loading content...

Implementors

impl NodeRegistryReader for NoOpNodeRegistry[src]

impl NodeRegistryReader for UnifiedNodeRegistry[src]

fn count_nodes(
    &self,
    predicates: &[MetadataPredicate]
) -> Result<u32, NodeRegistryError>
[src]

This implementation of count_nodes does not take into account the replaced nodes in the node registry, in order to keep the overall operation more efficient.

impl NodeRegistryReader for YamlNodeRegistry[src]

Loading content...