bee_tangle/
event.rs

1// Copyright 2020-2021 IOTA Stiftung
2// SPDX-License-Identifier: Apache-2.0
3
4use bee_message::milestone::{Milestone, MilestoneIndex};
5
6/// An event that indicates that the latest milestone has changed.
7#[derive(Clone)]
8pub struct LatestMilestoneChanged {
9    /// The index of the milestone
10    pub index: MilestoneIndex,
11    /// The milestone data
12    pub milestone: Milestone,
13}
14
15/// An event that indicates that the solid milestone has changed.
16#[derive(Clone)]
17pub struct SolidMilestoneChanged {
18    /// The index of the milestone
19    pub index: MilestoneIndex,
20    /// The milestone data
21    pub milestone: Milestone,
22}
23
24/// An event that indicates that the confirmed milestone has changed.
25#[derive(Clone)]
26pub struct ConfirmedMilestoneChanged {
27    /// The index of the milestone
28    pub index: MilestoneIndex,
29    /// The milestone data
30    pub milestone: Milestone,
31}
32
33/// An event that indicates that the snapshot milestone has changed.
34#[derive(Clone)]
35pub struct SnapshotMilestoneIndexChanged {
36    /// The index of the milestone
37    pub index: MilestoneIndex,
38}
39
40/// An event that indicates that the pruning milestone has changed.
41#[derive(Clone)]
42pub struct PruningMilestoneIndexChanged {
43    /// The index of the milestone
44    pub index: MilestoneIndex,
45}