@@ -57,6 +57,7 @@ use crate::builder::sanitize_alias;
5757pub use crate :: config:: { default_config, ElectrumSyncConfig , EsploraSyncConfig , TorConfig } ;
5858pub use crate :: entropy:: { generate_entropy_mnemonic, NodeEntropy , WordCount } ;
5959use crate :: error:: Error ;
60+ use crate :: ffi:: io:: IOError ;
6061use crate :: io:: utils:: check_namespace_key_validity;
6162pub use crate :: liquidity:: LSPS1OrderStatus ;
6263pub use crate :: logger:: { LogLevel , LogRecord , LogWriter } ;
@@ -154,104 +155,6 @@ impl VssClientHeaderProvider for VssHeaderProviderAdapter {
154155 }
155156}
156157
157- #[ derive( Debug ) ]
158- #[ cfg_attr( feature = "uniffi" , derive( uniffi:: Error ) ) ]
159- pub enum IOError {
160- NotFound ,
161- PermissionDenied ,
162- ConnectionRefused ,
163- ConnectionReset ,
164- ConnectionAborted ,
165- NotConnected ,
166- AddrInUse ,
167- AddrNotAvailable ,
168- BrokenPipe ,
169- AlreadyExists ,
170- WouldBlock ,
171- InvalidInput ,
172- InvalidData ,
173- TimedOut ,
174- WriteZero ,
175- Interrupted ,
176- UnexpectedEof ,
177- Other ,
178- }
179-
180- impl From < bitcoin:: io:: Error > for IOError {
181- fn from ( error : bitcoin:: io:: Error ) -> Self {
182- match error. kind ( ) {
183- bitcoin:: io:: ErrorKind :: NotFound => IOError :: NotFound ,
184- bitcoin:: io:: ErrorKind :: PermissionDenied => IOError :: PermissionDenied ,
185- bitcoin:: io:: ErrorKind :: ConnectionRefused => IOError :: ConnectionRefused ,
186- bitcoin:: io:: ErrorKind :: ConnectionReset => IOError :: ConnectionReset ,
187- bitcoin:: io:: ErrorKind :: ConnectionAborted => IOError :: ConnectionAborted ,
188- bitcoin:: io:: ErrorKind :: NotConnected => IOError :: NotConnected ,
189- bitcoin:: io:: ErrorKind :: AddrInUse => IOError :: AddrInUse ,
190- bitcoin:: io:: ErrorKind :: AddrNotAvailable => IOError :: AddrNotAvailable ,
191- bitcoin:: io:: ErrorKind :: BrokenPipe => IOError :: BrokenPipe ,
192- bitcoin:: io:: ErrorKind :: AlreadyExists => IOError :: AlreadyExists ,
193- bitcoin:: io:: ErrorKind :: WouldBlock => IOError :: WouldBlock ,
194- bitcoin:: io:: ErrorKind :: InvalidInput => IOError :: InvalidInput ,
195- bitcoin:: io:: ErrorKind :: InvalidData => IOError :: InvalidData ,
196- bitcoin:: io:: ErrorKind :: TimedOut => IOError :: TimedOut ,
197- bitcoin:: io:: ErrorKind :: WriteZero => IOError :: WriteZero ,
198- bitcoin:: io:: ErrorKind :: Interrupted => IOError :: Interrupted ,
199- bitcoin:: io:: ErrorKind :: UnexpectedEof => IOError :: UnexpectedEof ,
200- bitcoin:: io:: ErrorKind :: Other => IOError :: Other ,
201- }
202- }
203- }
204-
205- impl From < IOError > for bitcoin:: io:: Error {
206- fn from ( error : IOError ) -> Self {
207- match error {
208- IOError :: NotFound => bitcoin:: io:: ErrorKind :: NotFound . into ( ) ,
209- IOError :: PermissionDenied => bitcoin:: io:: ErrorKind :: PermissionDenied . into ( ) ,
210- IOError :: ConnectionRefused => bitcoin:: io:: ErrorKind :: ConnectionRefused . into ( ) ,
211- IOError :: ConnectionReset => bitcoin:: io:: ErrorKind :: ConnectionReset . into ( ) ,
212- IOError :: ConnectionAborted => bitcoin:: io:: ErrorKind :: ConnectionAborted . into ( ) ,
213- IOError :: NotConnected => bitcoin:: io:: ErrorKind :: NotConnected . into ( ) ,
214- IOError :: AddrInUse => bitcoin:: io:: ErrorKind :: AddrInUse . into ( ) ,
215- IOError :: AddrNotAvailable => bitcoin:: io:: ErrorKind :: AddrNotAvailable . into ( ) ,
216- IOError :: BrokenPipe => bitcoin:: io:: ErrorKind :: BrokenPipe . into ( ) ,
217- IOError :: AlreadyExists => bitcoin:: io:: ErrorKind :: AlreadyExists . into ( ) ,
218- IOError :: WouldBlock => bitcoin:: io:: ErrorKind :: WouldBlock . into ( ) ,
219- IOError :: InvalidInput => bitcoin:: io:: ErrorKind :: InvalidInput . into ( ) ,
220- IOError :: InvalidData => bitcoin:: io:: ErrorKind :: InvalidData . into ( ) ,
221- IOError :: TimedOut => bitcoin:: io:: ErrorKind :: TimedOut . into ( ) ,
222- IOError :: WriteZero => bitcoin:: io:: ErrorKind :: WriteZero . into ( ) ,
223- IOError :: Interrupted => bitcoin:: io:: ErrorKind :: Interrupted . into ( ) ,
224- IOError :: UnexpectedEof => bitcoin:: io:: ErrorKind :: UnexpectedEof . into ( ) ,
225- IOError :: Other => bitcoin:: io:: ErrorKind :: Other . into ( ) ,
226- }
227- }
228- }
229-
230- impl std:: fmt:: Display for IOError {
231- fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
232- match self {
233- IOError :: NotFound => write ! ( f, "NotFound" ) ,
234- IOError :: PermissionDenied => write ! ( f, "PermissionDenied" ) ,
235- IOError :: ConnectionRefused => write ! ( f, "ConnectionRefused" ) ,
236- IOError :: ConnectionReset => write ! ( f, "ConnectionReset" ) ,
237- IOError :: ConnectionAborted => write ! ( f, "ConnectionAborted" ) ,
238- IOError :: NotConnected => write ! ( f, "NotConnected" ) ,
239- IOError :: AddrInUse => write ! ( f, "AddrInUse" ) ,
240- IOError :: AddrNotAvailable => write ! ( f, "AddrNotAvailable" ) ,
241- IOError :: BrokenPipe => write ! ( f, "BrokenPipe" ) ,
242- IOError :: AlreadyExists => write ! ( f, "AlreadyExists" ) ,
243- IOError :: WouldBlock => write ! ( f, "WouldBlock" ) ,
244- IOError :: InvalidInput => write ! ( f, "InvalidInput" ) ,
245- IOError :: InvalidData => write ! ( f, "InvalidData" ) ,
246- IOError :: TimedOut => write ! ( f, "TimedOut" ) ,
247- IOError :: WriteZero => write ! ( f, "WriteZero" ) ,
248- IOError :: Interrupted => write ! ( f, "Interrupted" ) ,
249- IOError :: UnexpectedEof => write ! ( f, "UnexpectedEof" ) ,
250- IOError :: Other => write ! ( f, "Other" ) ,
251- }
252- }
253- }
254-
255158/// FFI-safe version of [`DynStoreTrait`].
256159///
257160/// [`DynStoreTrait`]: crate::types::DynStoreTrait
0 commit comments