Struct SimpleThreadLifecycle
pub struct SimpleThreadLifecycle { /* private fields */ }Expand description
Simple thread lifecycle implementation
Trait Implementations§
§impl Debug for SimpleThreadLifecycle
impl Debug for SimpleThreadLifecycle
§impl ThreadLifecycle for SimpleThreadLifecycle
impl ThreadLifecycle for SimpleThreadLifecycle
§fn state(&self) -> ThreadState
fn state(&self) -> ThreadState
Get current thread state
§fn transition(&mut self, new_state: ThreadState) -> Result<(), NerveError>
fn transition(&mut self, new_state: ThreadState) -> Result<(), NerveError>
Transition to a new state
§fn can_transition_to(&self, target_state: ThreadState) -> bool
fn can_transition_to(&self, target_state: ThreadState) -> bool
Check if transition to target state is valid
§fn time_in_current_state(&self) -> Duration
fn time_in_current_state(&self) -> Duration
Get time spent in current state
Auto Trait Implementations§
impl Freeze for SimpleThreadLifecycle
impl RefUnwindSafe for SimpleThreadLifecycle
impl Send for SimpleThreadLifecycle
impl Sync for SimpleThreadLifecycle
impl Unpin for SimpleThreadLifecycle
impl UnwindSafe for SimpleThreadLifecycle
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