1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//! # Request module.
//!
//! A [`Request`] is the type of data sent by the client to the server
//! in order to control the timer.

/// The request struct.
///
/// Request are sent by clients and received by servers.
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum Request {
    /// Request the timer to start with the first work cycle.
    Start,

    /// Request the state, the cycle and the value of the timer.
    Get,

    /// Request to change the current timer duration.
    Set(usize),

    /// Request to pause the timer. A paused timer freezes, which
    /// means it keeps its state, cycle and value till it get resumed.
    Pause,

    /// Request to resume the paused timer.
    Resume,

    /// Request to stop the timer. Stopping the timer resets the
    /// state, cycle and the value.
    Stop,
}