aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
blob: a02eb206363e9f86673d6aa8b86be0f735c510d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#![feature(cursor_remaining)]
#![feature(hash_drain_filter)]
#![feature(once_cell)]
mod client;
mod common;
mod error;
mod recv;
mod send;
mod share;

pub use client::*;
pub use common::*;
pub use error::*;
use recv::*;
pub use send::*;
pub use share::*;
pub use ticker_mod::*;

mod ticker_mod {
    #[macro_export]
    macro_rules! ticker {
		($duration:expr, $close:expr, $body:block) => {
			let mut interval = tokio::time::interval($duration);

			while tokio::select!{
				_ = interval.tick() => true,
				_ = $close.changed() => false,
			} $body
		};
	}
}