inexor_rgf_core_reactive/behaviour/
error.rs

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
use crate::model::BehaviourTypeId;
use crate::model::DataType;

#[derive(Debug)]
pub enum BehaviourTransitionError {
    InvalidTransition,
    BehaviourInvalid(BehaviourInvalid),
    BehaviourInitializationFailed(BehaviourInitializationFailed),
    BehaviourConnectFailed(BehaviourConnectFailed),
    BehaviourDisconnectFailed(BehaviourDisconnectFailed),
}

#[derive(Debug)]
pub enum BehaviourCreationError {
    /// Creating the behaviour failed because the behaviour is already applied on the reactive instance.
    BehaviourAlreadyApplied(BehaviourTypeId),
    /// Creating the behaviour failed because connecting the behaviour failed.
    BehaviourTransitionError(BehaviourTransitionError),
}

#[derive(Debug)]
pub struct BehaviourConnectFailed {}

#[derive(Debug)]
pub struct BehaviourDisconnectFailed {}

#[derive(Debug)]
pub enum BehaviourReconnectFailed {
    BehaviourConnectFailed(BehaviourConnectFailed),
    BehaviourDisconnectFailed(BehaviourDisconnectFailed),
}

#[derive(Debug)]
pub struct BehaviourInitializationFailed {}

#[derive(Debug)]
pub struct BehaviourShutdownFailed {}

#[derive(Debug)]
pub enum BehaviourInvalid {
    /// The behaviour is invalid because one or multiple properties are invalid.
    BehaviourPropertyInvalid(BehaviourPropertyInvalid),
}

#[derive(Debug)]
pub enum BehaviourPropertyInvalid {
    /// The property with the given name is missing.
    PropertyMissing(String),

    /// The outbound property with the given name is missing.
    OutboundPropertyMissing(String),

    /// The inbound property with the given name is missing.
    InboundPropertyMissing(String),

    /// The property with the given name has a data type which is not the expected data type.
    InvalidDataType(String, DataType, DataType),
}