vce-engine 0.1.1

The generic state substrate of the Virtual Computing Engine (VCE)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Subscription handles.

/// The identity of an [`EventBus`](super::event_bus::EventBus) subscription.
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
pub struct SubscriptionId(usize);

impl SubscriptionId {
    pub(crate) fn new(value: usize) -> Self {
        Self(value)
    }

    /// Returns the raw subscription counter value.
    ///
    /// Primarily useful for debugging and tests.
    pub fn get(self) -> usize {
        self.0
    }
}