pub struct Reloader { /* private fields */ }
Expand description
Basic Reloader which can check timestamps on files and then callback functions supplied by the reload responder
Implementations§
Source§impl Reloader
impl Reloader
Sourcepub fn create(responder: Box<dyn ReloadResponder>) -> Self
pub fn create(responder: Box<dyn ReloadResponder>) -> Self
Create a new instance of a reload with the designated ReloadResponder and start waiting for file changes
Sourcepub fn start(self) -> Self
pub fn start(self) -> Self
Start watching for and invoking reload changes, this will spawn threads to watch files
Sourcepub fn check_for_reload(&mut self) -> ReloadState
pub fn check_for_reload(&mut self) -> ReloadState
Call this each frame, if ReloadResult::Reload you must then clean up any data in preperation for a reload
Sourcepub fn complete_reload(&mut self)
pub fn complete_reload(&mut self)
Once data is cleaned up and it is safe to proceed this functions must be called
Auto Trait Implementations§
impl Freeze for Reloader
impl RefUnwindSafe for Reloader
impl Send for Reloader
impl Sync for Reloader
impl Unpin for Reloader
impl UnwindSafe for Reloader
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