Skip to main content

TopologyCounts

Trait TopologyCounts 

Source
pub trait TopologyCounts: TopologyBase {
    // Required methods
    fn element_count(&self) -> usize;
    fn relation_count(&self) -> usize;
}
Expand description

Count capability for a topology view.

This trait is separated from TopologyBase because counts are a capability. Some views can report global counts cheaply; others expose only local, paged, generated, or filtered topology and should define counts only when the result is meaningful for that view.

§Performance

Methods should be O(1) unless an implementation documents a weaker contract.

Required Methods§

Source

fn element_count(&self) -> usize

Returns the number of elements visible in this topology view.

§Performance

Expected O(1) unless the implementation documents otherwise.

Source

fn relation_count(&self) -> usize

Returns the number of relations visible in this topology view.

§Performance

Expected O(1) unless the implementation documents otherwise.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§