Procházet zdrojové kódy

binan 接口提交

875428575@qq.com před 2 roky
rodič
revize
c1a531fc7e
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 4 4
      src/exchange_libs.rs

+ 4 - 4
src/exchange_libs.rs

@@ -537,7 +537,7 @@ impl SocketTool {
             subscription: subscription,
         }
     }
-    pub(crate) fn run(&self, exc_name: String, parse_fn: ParseFn) {
+    pub(crate) fn run(&self, exc_name: String, parse_fn:  impl Fn()) {
         while true {//一个粗糙的 断开重连操作
             /*****消息溜***/
             let mut stdout = io::stdout();
@@ -748,7 +748,7 @@ impl SocketTool {
     }
 
     //币安--订阅
-    pub fn binance_run(b_array: Vec<&str>, subscription_name: String, parse_fn: ParseFn) {
+    pub fn binance_run(b_array: Vec<&str>, subscription_name: String, parse_fn: impl Fn()) {
         let mut params = vec![];
 
         for item in &b_array {
@@ -778,7 +778,7 @@ impl SocketTool {
         biance_socke.run("binance".to_string(), parse_fn);
     }
 
-    fn hook_fn_binance(message: String, parse_fn: ParseFn) {
+    fn hook_fn_binance(message: String, parse_fn: impl Fn()) {
         println!("币安--回调函数:响应: {}", message);
         parse_fn(message);
     }
@@ -840,7 +840,7 @@ impl SocketTool {
 //     );
 //     biance_socke.run("binance".to_string(), parse_fn);
 // }
-    fn hook_fn_okx(message: String, parse_fn: ParseFn) {
+    fn hook_fn_okx(message: String, parse_fn: impl Fn()) {
         println!("OKX--回调函数:响应: {}", message);
         parse_fn(message);
     }