NodeAggregatorTrait

Trait NodeAggregatorTrait 

Source
pub trait NodeAggregatorTrait<T: Clone + Send + Sync>: Send + Sync {
    // Required method
    fn aggregate_up(
        &self,
        start_node: &NodeId,
        state: Arc<State>,
    ) -> impl Future<Output = ForgeResult<HashMap<NodeId, T>>> + Send;
}
Expand description

节点聚合器 Trait

定义树形结构的自下而上聚合计算接口

Required Methods§

Source

fn aggregate_up( &self, start_node: &NodeId, state: Arc<State>, ) -> impl Future<Output = ForgeResult<HashMap<NodeId, T>>> + Send

执行自下而上的聚合计算

§参数
  • start_node: 起始节点 ID(通常是叶子节点)
  • state: 状态引用
§返回值

所有节点的聚合结果 HashMap

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Clone + Send + Sync + 'static> NodeAggregatorTrait<T> for NodeAggregator<T>