aboutsummaryrefslogtreecommitdiff
path: root/games/rstnode/src/_loop.rs
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2021-02-06 19:40:53 +0100
committerKatharina Fey <kookie@spacekookie.de>2021-02-06 19:42:04 +0100
commitcf9392a33bb99ae581f818d3ddb8be1231521a02 (patch)
tree8295d8a4ed199c3263eadd8f1a508b98567a44f7 /games/rstnode/src/_loop.rs
parent56d96b2f22bf6a61ff992b000215dc3a2c2448ad (diff)
rstnode: restructure project into workspace and sub-crates
Diffstat (limited to '')
-rw-r--r--games/rstnode/rst-core/src/_loop.rs (renamed from games/rstnode/src/_loop.rs)7
1 files changed, 5 insertions, 2 deletions
diff --git a/games/rstnode/src/_loop.rs b/games/rstnode/rst-core/src/_loop.rs
index 862325490322..ac4619622ed3 100644
--- a/games/rstnode/src/_loop.rs
+++ b/games/rstnode/rst-core/src/_loop.rs
@@ -1,4 +1,7 @@
//! A timed loop implementation
+//!
+//! This is a utility to be used in the server simulation to make sure
+//! that a simulation step takes a certain amount of time to execute.
use async_std::{future::Future, task};
use chrono::{DateTime, Utc};
@@ -16,7 +19,7 @@ const TICKS: u64 = 100;
const TICK_TIME: Duration = Duration::from_millis(1000 / TICKS);
/// Run a timed loop until you no longer want to
-pub fn block_loop<F>(run: Arc<AtomicBool>, f: F)
+pub(crate) fn block_loop<F>(run: Arc<AtomicBool>, f: F)
where
F: Future<Output = ()> + Send + Copy + 'static,
{
@@ -30,7 +33,7 @@ where
}
/// Run a detached timed loop until you no longer want to
-pub fn spawn_loop<F>(run: Arc<AtomicBool>, f: F)
+pub(crate) fn spawn_loop<F>(run: Arc<AtomicBool>, f: F)
where
F: Future<Output = ()> + Send + Copy + 'static,
{