Struct singletonThread::SingletonThread
source · pub struct SingletonThread { /* private fields */ }Implementations§
source§impl SingletonThread
impl SingletonThread
sourcepub fn newFiltered(
mainFn: impl Fn() + Send + Sync + 'static,
filterFn: impl Fn() -> bool + Send + Sync + 'static
) -> Self
pub fn newFiltered( mainFn: impl Fn() + Send + Sync + 'static, filterFn: impl Fn() -> bool + Send + Sync + 'static ) -> Self
create a new singletonThread with a filter filter is run each time, after testing if thread is running or not filter must return true if the thread can be launched, or false if not
sourcepub fn thread_launch(&mut self) -> bool
pub fn thread_launch(&mut self) -> bool
try to launch a new run, check if not running AND the filter function return true return if the thread have been launched
sourcepub fn setDuration(&mut self, duration: Duration)
pub fn setDuration(&mut self, duration: Duration)
minimum duration before another run can occur, default 166ms (60fps)
sourcepub fn setDuration_FPS(&mut self, fps: u8)
pub fn setDuration_FPS(&mut self, fps: u8)
minimum duration before another run can occur, default 166ms (60fps)
sourcepub fn setLoop(&mut self, canLoop: bool)
pub fn setLoop(&mut self, canLoop: bool)
define if the thread auto relaunch himself (technically it just use the same thread) set to false if you want to stop a looped thread that running.
pub fn setThreadName(&mut self, name: impl Into<String>)
pub fn setThreadPriority(&mut self, priority: ThreadPriority)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SingletonThread
impl Send for SingletonThread
impl Sync for SingletonThread
impl Unpin for SingletonThread
impl !UnwindSafe for SingletonThread
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more