ink_stroke_modeler_rs/
error.rs1#[derive(Debug, Clone, thiserror::Error)]
2#[non_exhaustive]
3pub enum ElementError {
4 #[error("A duplicate element is sent to the modeler")]
5 Duplicate,
6 #[error("A sent element has a time earlier than the previous one")]
7 NegativeTimeDelta,
8 #[error("Sent element order is incorrect")]
9 Order {
10 #[from]
11 src: ElementOrderError,
12 },
13 #[error("Sent element's time is too far apart from the previous one")]
14 TooFarApart,
15}
16
17#[derive(Debug, Clone, thiserror::Error)]
18#[non_exhaustive]
19#[allow(clippy::enum_variant_names)]
20pub enum ElementOrderError {
21 #[error("Down Event is not the first or occurred after a different event")]
22 UnexpectedDown,
23 #[error("Move event occurred before a initial down event")]
24 UnexpectedMove,
25 #[error("No other event occurred before an up event")]
26 UnexpectedUp,
27}
28
29#[derive(Debug, Clone, thiserror::Error)]
30#[non_exhaustive]
31pub enum ModelerError {
32 #[error("Input element error")]
33 Element {
34 #[from]
35 src: ElementError,
36 },
37}