瀏覽代碼

优化返回

875428575@qq.com 2 年之前
父節點
當前提交
cc86d8e0a0
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      exchanges/src/response_base.rs

+ 7 - 2
exchanges/src/response_base.rs

@@ -1,6 +1,7 @@
-/**交易所返回数据处理之后,同意保存格式,为了内部其他接口调用*/
-pub enum ChannelType {}
+use std::fmt;
+use std::fmt::Formatter;
 
+/**交易所返回数据处理之后,同意保存格式,为了内部其他接口调用*/
 #[derive(Debug, Clone)]
 pub struct ResponseData {
     pub label: String,
@@ -25,5 +26,9 @@ impl ResponseData {
             time: 0,
         }
     }
+
+    pub fn to_string(&self) -> String {
+        format!("{:?}", self)
+    }
 }