Skip to main content

d3_components/
coordinators.rs

1#![allow(dead_code)]
2#[allow(unused_imports)] use super::*;
3use crate::components::ComponentSender;
4
5/// CoordinatorInfo describes an active coordinator. It provides the coordinator type
6/// and the sender for the coordinator. A coordinator, is a specialization of a
7/// component, and shares the same instruction set as all other components and coordinators.
8#[derive(Debug, Clone)]
9pub struct CoordinatorInfo {
10    coordinator: settings::Coordinator,
11    sender: ComponentSender,
12}
13impl CoordinatorInfo {
14    /// Creates and new CoordinatorInfo struct and returns it.
15    pub const fn new(coordinator: settings::Coordinator, sender: ComponentSender) -> Self { Self { coordinator, sender } }
16    /// Get the coordinator type for this coordinator
17    pub const fn coordinator(&self) -> &settings::Coordinator { &self.coordinator }
18    /// Get a reference to the sender for this coordinator
19    pub const fn sender(&self) -> &ComponentSender { &self.sender }
20}