@@ -21,7 +21,6 @@ pub use detector::Detector;
21
21
pub use detector:: DetectorCache ;
22
22
use editoast_schemas:: infra:: Direction ;
23
23
use editoast_schemas:: primitives:: OSRDIdentified ;
24
- use editoast_schemas:: primitives:: OSRDObject ;
25
24
use editoast_schemas:: primitives:: ObjectType ;
26
25
pub use electrification:: Electrification ;
27
26
pub use errors:: InfraError ;
@@ -80,65 +79,6 @@ editoast_common::schemas! {
80
79
operation:: schemas( ) ,
81
80
}
82
81
83
- #[ derive( Deserialize , Serialize , Clone , Debug , PartialEq , Eq , Hash ) ]
84
- #[ serde( tag = "type" , deny_unknown_fields) ]
85
- pub enum Waypoint {
86
- BufferStop { id : Identifier } ,
87
- Detector { id : Identifier } ,
88
- }
89
-
90
- impl Waypoint {
91
- /// Create a new detector stop waypoint
92
- pub fn new_detector < T : AsRef < str > > ( detector : T ) -> Self {
93
- Self :: Detector {
94
- id : detector. as_ref ( ) . into ( ) ,
95
- }
96
- }
97
-
98
- /// Create a new buffer stop waypoint
99
- pub fn new_buffer_stop < T : AsRef < str > > ( bf : T ) -> Self {
100
- Self :: BufferStop {
101
- id : bf. as_ref ( ) . into ( ) ,
102
- }
103
- }
104
-
105
- /// Return whether the waypoint is a detector
106
- pub fn is_detector ( & self ) -> bool {
107
- matches ! ( self , Waypoint :: Detector { .. } )
108
- }
109
-
110
- // Return whether the waypoint is a buffer stop
111
- pub fn is_buffer_stop ( & self ) -> bool {
112
- matches ! ( self , Waypoint :: BufferStop { .. } )
113
- }
114
- }
115
-
116
- impl Default for Waypoint {
117
- fn default ( ) -> Self {
118
- Self :: Detector {
119
- id : "InvalidRef" . into ( ) ,
120
- }
121
- }
122
- }
123
-
124
- impl OSRDIdentified for Waypoint {
125
- fn get_id ( & self ) -> & String {
126
- match self {
127
- Waypoint :: BufferStop { id } => id,
128
- Waypoint :: Detector { id } => id,
129
- }
130
- }
131
- }
132
-
133
- impl OSRDObject for Waypoint {
134
- fn get_type ( & self ) -> ObjectType {
135
- match self {
136
- Waypoint :: BufferStop { .. } => ObjectType :: BufferStop ,
137
- Waypoint :: Detector { .. } => ObjectType :: Detector ,
138
- }
139
- }
140
- }
141
-
142
82
#[ derive( Debug , Derivative , Clone , Deserialize , Serialize , PartialEq , ToSchema ) ]
143
83
#[ serde( deny_unknown_fields) ]
144
84
#[ derivative( Default ) ]
0 commit comments