pub struct Runtime<R> { /* private fields */ }Expand description
⬡ A handle to the live execution context of a running system.
📍 run/time
📦 size_of::<Runtime<()>>() == 12 bytes / 96 bits #️⃣ #[cfg(target_pointer_width = “32”)]
📦 size_of::<Runtime<()>>() == 16 bytes / 128 bits #️⃣ #[cfg(target_pointer_width = “64”)]
Runtime stores the long-lived state that defines an active run:
- its committed regime,
- its logical tick,
- and its lifecycle phase.
It is a context object, not a scheduler or loop controller.
Implementations§
Source§impl<R> Runtime<R>
impl<R> Runtime<R>
Sourcepub const fn regime_mut(&mut self) -> &mut R
pub const fn regime_mut(&mut self) -> &mut R
Returns a mutable reference to the committed regime.
Sourcepub const fn tick(&self) -> RuntimeTick
pub const fn tick(&self) -> RuntimeTick
Returns the current logical tick.
Sourcepub const fn can_advance(&self) -> bool
pub const fn can_advance(&self) -> bool
Returns true if logical progression is currently allowed.
Sourcepub const fn tick_once(&mut self)
pub const fn tick_once(&mut self)
Advances the logical tick by one.
This does not check the current phase.
Sourcepub const fn advance_mut(&mut self, delta: u64)
pub const fn advance_mut(&mut self, delta: u64)
Advances the logical tick by delta.
This does not check the current phase.
Sourcepub const fn transition(&mut self, next: RunPhase) -> bool
pub const fn transition(&mut self, next: RunPhase) -> bool
Attempts to transition to next.
Returns true if the transition is valid.
Trait Implementations§
impl<R: Copy> Copy for Runtime<R>
impl<R: Eq> Eq for Runtime<R>
Source§impl<R: PartialEq> PartialEq for Runtime<R>
impl<R: PartialEq> PartialEq for Runtime<R>
impl<R> StructuralPartialEq for Runtime<R>
Auto Trait Implementations§
impl<R> Freeze for Runtime<R>where
R: Freeze,
impl<R> RefUnwindSafe for Runtime<R>where
R: RefUnwindSafe,
impl<R> Send for Runtime<R>where
R: Send,
impl<R> Sync for Runtime<R>where
R: Sync,
impl<R> Unpin for Runtime<R>where
R: Unpin,
impl<R> UnsafeUnpin for Runtime<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for Runtime<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
Returns a deterministic hash of the
TypeId of Self using a custom hasher.Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
Available on crate feature
alloc only.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
Source§impl<T> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
The alignment of this type in bytes.
Source§fn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Returns the alignment of this type in bytes.
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> MemExt for Twhere
T: ?Sized,
impl<T> MemExt for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Know whether dropping values of this type matters, in compile-time.
Source§fn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Returns the minimum alignment of the type in bytes. Read more
Source§fn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Returns the alignment of the pointed-to value in bytes. Read more
Source§fn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Returns the size of a type in bytes. Read more
Source§fn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Returns the size of the pointed-to value in bytes. Read more
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
Returns
true if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
Forgets about
self without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
Available on crate feature
unsafe_layout only.Returns the value of type
T represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
Available on crate feature
unsafe_layout only.Returns the value of type
T represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
Available on crate feature
unsafe_slice only.