@@ -134,34 +134,40 @@ impl EventSubscriber<'_> {
134
134
#[ derive( Clone , Debug , Deserialize , From , PartialEq ) ]
135
135
#[ serde( tag = "type" ) ]
136
136
pub enum Event {
137
- #[ serde( deserialize_with = "self::deserialize_pool_created" ) ]
138
- ConnectionPoolCreated ( PoolCreatedEvent ) ,
139
- ConnectionPoolClosed ( PoolClosedEvent ) ,
140
- ConnectionPoolReady ( PoolReadyEvent ) ,
137
+ #[ serde(
138
+ deserialize_with = "self::deserialize_pool_created" ,
139
+ rename = "ConnectionPoolCreated"
140
+ ) ]
141
+ PoolCreated ( PoolCreatedEvent ) ,
142
+ #[ serde( rename = "ConnectionPoolClosed" ) ]
143
+ PoolClosed ( PoolClosedEvent ) ,
144
+ #[ serde( rename = "ConnectionPoolReady" ) ]
145
+ PoolReady ( PoolReadyEvent ) ,
141
146
ConnectionCreated ( ConnectionCreatedEvent ) ,
142
147
ConnectionReady ( ConnectionReadyEvent ) ,
143
148
ConnectionClosed ( ConnectionClosedEvent ) ,
144
149
ConnectionCheckOutStarted ( ConnectionCheckoutStartedEvent ) ,
145
150
#[ serde( deserialize_with = "self::deserialize_checkout_failed" ) ]
146
151
ConnectionCheckOutFailed ( ConnectionCheckoutFailedEvent ) ,
147
152
ConnectionCheckedOut ( ConnectionCheckedOutEvent ) ,
148
- ConnectionPoolCleared ( PoolClearedEvent ) ,
153
+ #[ serde( rename = "ConnectionPoolCleared" ) ]
154
+ PoolCleared ( PoolClearedEvent ) ,
149
155
ConnectionCheckedIn ( ConnectionCheckedInEvent ) ,
150
156
}
151
157
152
158
impl Event {
153
159
pub fn name ( & self ) -> & ' static str {
154
160
match self {
155
- Event :: ConnectionPoolCreated ( _) => "ConnectionPoolCreated" ,
156
- Event :: ConnectionPoolReady ( _) => "ConnectionPoolReady" ,
157
- Event :: ConnectionPoolClosed ( _) => "ConnectionPoolClosed" ,
161
+ Event :: PoolCreated ( _) => "ConnectionPoolCreated" ,
162
+ Event :: PoolReady ( _) => "ConnectionPoolReady" ,
163
+ Event :: PoolClosed ( _) => "ConnectionPoolClosed" ,
158
164
Event :: ConnectionCreated ( _) => "ConnectionCreated" ,
159
165
Event :: ConnectionReady ( _) => "ConnectionReady" ,
160
166
Event :: ConnectionClosed ( _) => "ConnectionClosed" ,
161
167
Event :: ConnectionCheckOutStarted ( _) => "ConnectionCheckOutStarted" ,
162
168
Event :: ConnectionCheckOutFailed ( _) => "ConnectionCheckOutFailed" ,
163
169
Event :: ConnectionCheckedOut ( _) => "ConnectionCheckedOut" ,
164
- Event :: ConnectionPoolCleared ( _) => "ConnectionPoolCleared" ,
170
+ Event :: PoolCleared ( _) => "ConnectionPoolCleared" ,
165
171
Event :: ConnectionCheckedIn ( _) => "ConnectionCheckedIn" ,
166
172
}
167
173
}
0 commit comments