pub struct SystemBuilder { /* private fields */ }Expand description
Builder for declaring a system’s metadata and component access.
Implementations§
Source§impl SystemBuilder
impl SystemBuilder
Sourcepub fn every(self, every: u64) -> Self
pub fn every(self, every: u64) -> Self
Sets the frequency divisor.
The system runs when tick_count % every == 0.
Default is 1 (every tick).
Sourcepub fn budget_ms(self, ms: u64) -> Self
pub fn budget_ms(self, ms: u64) -> Self
Sets the CPU budget for this system in milliseconds.
When set, the system can check ctx.budget().is_expired() to
yield early. Systems without a budget get an unlimited one.
Sourcepub fn run<F: FnMut(&mut dyn SystemContext) + Send + 'static>(
self,
runner: F,
) -> SystemDescriptor
pub fn run<F: FnMut(&mut dyn SystemContext) + Send + 'static>( self, runner: F, ) -> SystemDescriptor
Finalizes the builder and registers the system with a runner.
Auto Trait Implementations§
impl Freeze for SystemBuilder
impl RefUnwindSafe for SystemBuilder
impl Send for SystemBuilder
impl Sync for SystemBuilder
impl Unpin for SystemBuilder
impl UnsafeUnpin for SystemBuilder
impl UnwindSafe for SystemBuilder
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