Skip to main content

grafix_toolbox/
kit.rs

1pub mod sync {
2	pub use std::sync::mpsc::{Receiver, SyncSender as Sender};
3	pub mod chan {
4		pub use std::sync::mpsc::sync_channel as bounded;
5	}
6}
7pub mod asyn {
8	pub mod chan {
9		pub use tokio::sync::mpsc::unbounded_channel as unbounded;
10	}
11	pub use tokio::sync::mpsc::{UnboundedReceiver as Receiver, UnboundedSender as Sender};
12}
13mod sync_pre {
14	pub mod arc {
15		pub use std::sync::Weak;
16	}
17	pub mod task {
18		pub async fn sleep_ms(ms: u64) {
19			sleep(std::time::Duration::from_millis(ms)).await
20	}
21		pub use super::super::policies::task::{GLRuntime, Runtime};
22		pub use futures_lite::future::block_on;
23		pub use tokio::{sync::Mutex, task::*, time::sleep};
24	}
25	pub use super::policies::task::{Task, pre::*};
26	pub use parking_lot::{Mutex, MutexGuard, RwLock, RwLockUpgradableReadGuard};
27	pub use std::sync::{Arc, Barrier, OnceLock, atomic::*};
28	pub use std::thread::{self, JoinHandle};
29}
30pub mod stdlib {
31	pub use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
32	pub use std::fmt::{Debug, Display, Formatter, Result as fmtRes};
33	pub use std::{borrow::Borrow, cell::Cell, iter, mem, ops, ptr, rc, rc::Rc, time};
34	pub use std::{cmp::Ordering as ord, marker::PhantomData as Dummy, mem::size_of as type_size};
35}
36pub mod lib {
37	pub use super::{GL, GL::types::*, policies::ext::*, policies::pre::*, stdlib::*, sync_pre::*};
38	#[cfg(feature = "adv_fs")]
39	pub use serde;
40	pub use {bitflags::bitflags, grafix_toolbox_macros::*};
41}
42pub mod math {
43	pub use super::policies::math::{ext::*, la, la::na};
44}
45pub mod GL {
46	pub use super::opengl::{event, pre::*, window};
47}
48pub mod text_color {
49	pub mod term {
50		pub mod term_color {
51			pub use yansi::disable;
52			pub use yansi::enable;
53		}
54		pub use yansi::Paint as text_color_prelude;
55	}
56}
57
58pub use policies::ext::*;
59
60#[macro_use]
61mod policies;
62#[macro_use]
63mod opengl;