1- use std:: { thread:: JoinHandle , time:: Duration } ;
1+ use std:: { fmt :: Display , thread:: JoinHandle , time:: Duration } ;
22
33use crate :: {
44 Header , IETPresentationConfig , LevelContainer , MetadataRefContainer , PoolEntry , TraceEntry ,
55 log_provider:: { LogProvider , LogProviderError , LogProviderResult } ,
66 tree_layer:: EnValueRef ,
77} ;
8- use crossbeam :: channel :: { Receiver , Sender } ;
8+ use crossbeam_channel :: { Receiver , Sender } ;
99
1010mod file_iet_log_provider;
1111pub use file_iet_log_provider:: * ;
@@ -14,15 +14,21 @@ pub use remote_storage::*;
1414mod remote_log_provider;
1515pub use remote_log_provider:: * ;
1616
17- #[ derive( derive_more:: Display ) ]
1817pub enum IETInfo {
19- #[ display( "Server started, waiting for connections" ) ]
2018 ServerStarted ,
21- #[ display( "Received connection" ) ]
2219 ReceivedConnection ,
23- #[ display( "Remote client closed connection" ) ]
2420 RemoteClosedConnection ,
2521}
22+ impl Display for IETInfo {
23+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
24+ match self {
25+ IETInfo :: ServerStarted => write ! ( f, "Server started, waiting for connections" ) ,
26+ IETInfo :: ReceivedConnection => write ! ( f, "Received connection" ) ,
27+ IETInfo :: RemoteClosedConnection => write ! ( f, "Remote client closed connection" ) ,
28+ }
29+ }
30+ }
31+
2632pub enum IETEvent {
2733 Error ( LogProviderError ) ,
2834 Info ( IETInfo ) ,
@@ -55,7 +61,7 @@ impl BaseIETLogProvider {
5561 // Notifier: Notify + Send + 'static,
5662 // Refresher: Refresh + Send + 'static,
5763 {
58- let ( tx, rx) = crossbeam :: channel :: unbounded ( ) ;
64+ let ( tx, rx) = crossbeam_channel :: unbounded ( ) ;
5965 let handle = std:: thread:: spawn ( move || worker_thread ( buf, tx, config) ) ;
6066 // no root data entry here, the client has to send it.
6167 Self { handle, receiver : rx, pool : vec ! [ ] , data : vec ! [ ] }
@@ -134,8 +140,8 @@ impl LogProvider for BaseIETLogProvider {
134140 }
135141 }
136142 Err ( y) => match y {
137- crossbeam :: channel :: TryRecvError :: Empty => ( ) ,
138- crossbeam :: channel :: TryRecvError :: Disconnected => ( ) ,
143+ crossbeam_channel :: TryRecvError :: Empty => ( ) ,
144+ crossbeam_channel :: TryRecvError :: Disconnected => ( ) ,
139145 } ,
140146 }
141147 }
0 commit comments