1919use std:: { future:: Future , path:: Path } ;
2020
2121use astarte_device_sdk:: {
22+ aggregate:: AstarteObject ,
2223 client:: { ClientDisconnect , RecvError } ,
2324 properties:: PropAccess ,
2425 store:: StoredProp ,
25- AstarteType , DeviceEvent , Error , Interface , IntoAstarteObject ,
26+ AstarteType , DeviceEvent , Error , Interface ,
2627} ;
2728use mockall:: mock;
2829
2930// Export public facing dependencies
3031pub use mockall;
3132
3233pub trait Client {
33- fn send_object_with_timestamp < D > (
34+ fn send_object_with_timestamp (
3435 & self ,
3536 interface_name : & str ,
3637 interface_path : & str ,
37- data : D ,
38+ data : AstarteObject ,
3839 timestamp : chrono:: DateTime < chrono:: Utc > ,
39- ) -> impl Future < Output = Result < ( ) , Error > > + Send
40- where
41- D : IntoAstarteObject + Send + ' static ;
40+ ) -> impl Future < Output = Result < ( ) , Error > > + Send ;
4241
43- fn send_object < D > (
42+ fn send_object (
4443 & self ,
4544 interface_name : & str ,
4645 interface_path : & str ,
47- data : D ,
48- ) -> impl Future < Output = Result < ( ) , Error > > + Send
49- where
50- D : IntoAstarteObject + Send + ' static ;
46+ data : AstarteObject ,
47+ ) -> impl Future < Output = Result < ( ) , Error > > + Send ;
5148
5249 fn send_with_timestamp < D > (
5350 & self ,
@@ -137,24 +134,20 @@ mock! {
137134 pub DeviceClient <S : ' static > { }
138135
139136 impl <S : Send + Sync > Client for DeviceClient <S > {
140- async fn send_object_with_timestamp< D > (
137+ async fn send_object_with_timestamp(
141138 & self ,
142139 interface_name: & str ,
143140 interface_path: & str ,
144- data: D ,
141+ data: AstarteObject ,
145142 timestamp: chrono:: DateTime <chrono:: Utc >,
146- ) -> Result <( ) , Error >
147- where
148- D : IntoAstarteObject + Send + ' static ;
143+ ) -> Result <( ) , Error >;
149144
150- async fn send_object< D > (
145+ async fn send_object(
151146 & self ,
152147 interface_name: & str ,
153148 interface_path: & str ,
154- data: D ,
155- ) -> Result <( ) , Error >
156- where
157- D : IntoAstarteObject + Send + ' static ;
149+ data: AstarteObject ,
150+ ) -> Result <( ) , Error >;
158151
159152 async fn send_with_timestamp<D >(
160153 & self ,
@@ -245,16 +238,13 @@ mod tests {
245238 struct CheckMocks { }
246239
247240 impl Client for CheckMocks {
248- async fn send_object_with_timestamp < D > (
241+ async fn send_object_with_timestamp (
249242 & self ,
250243 interface_name : & str ,
251244 interface_path : & str ,
252- data : D ,
245+ data : AstarteObject ,
253246 timestamp : chrono:: DateTime < chrono:: Utc > ,
254- ) -> Result < ( ) , Error >
255- where
256- D : IntoAstarteObject + Send + ' static ,
257- {
247+ ) -> Result < ( ) , Error > {
258248 astarte_device_sdk:: Client :: send_object_with_timestamp (
259249 self ,
260250 interface_name,
@@ -265,15 +255,12 @@ mod tests {
265255 . await
266256 }
267257
268- async fn send_object < D > (
258+ async fn send_object (
269259 & self ,
270260 interface_name : & str ,
271261 interface_path : & str ,
272- data : D ,
273- ) -> Result < ( ) , Error >
274- where
275- D : IntoAstarteObject + Send + ' static ,
276- {
262+ data : AstarteObject ,
263+ ) -> Result < ( ) , Error > {
277264 astarte_device_sdk:: Client :: send_object ( self , interface_name, interface_path, data)
278265 . await
279266 }
@@ -320,28 +307,22 @@ mod tests {
320307 }
321308
322309 impl astarte_device_sdk:: Client for CheckMocks {
323- async fn send_object_with_timestamp < D > (
310+ async fn send_object_with_timestamp (
324311 & self ,
325312 _interface_name : & str ,
326313 _interface_path : & str ,
327- _data : D ,
314+ _data : AstarteObject ,
328315 _timestamp : chrono:: DateTime < chrono:: Utc > ,
329- ) -> Result < ( ) , Error >
330- where
331- D : IntoAstarteObject + Send ,
332- {
316+ ) -> Result < ( ) , Error > {
333317 Ok ( ( ) )
334318 }
335319
336- async fn send_object < D > (
320+ async fn send_object (
337321 & self ,
338322 _interface_name : & str ,
339323 _interface_path : & str ,
340- _data : D ,
341- ) -> Result < ( ) , Error >
342- where
343- D : IntoAstarteObject + Send ,
344- {
324+ _data : AstarteObject ,
325+ ) -> Result < ( ) , Error > {
345326 Ok ( ( ) )
346327 }
347328
0 commit comments