kucoin_arbitrage 0.0.11

Event-Driven Kucoin Arbitrage Framework in Async Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::model::counter::Counter;
use std::sync::Arc;
use tokio::sync::Mutex;

pub async fn increment(counter: Arc<Mutex<Counter>>) {
    let mut p = counter.lock().await;
    p.data_count += 1;
}

pub async fn count(counter: Arc<Mutex<Counter>>) -> u64 {
    let p = counter.lock().await;
    p.data_count
}

pub async fn reset(counter: Arc<Mutex<Counter>>) {
    let mut p = counter.lock().await;
    p.data_count = 0;
}