pub struct WakeDeadline(/* private fields */);Expand description
Per-tick “tick again no later than this” request, the timed counterpart of
AnimationsActive.
A system whose work comes due at a known instant with nothing else to wake
the loop (a script timer, a delayed transition) calls Self::request
with that instant. Several requests keep the earliest. Like
AnimationsActive, reset_wake_deadline clears it at the top of every
tick and each driver re-requests only while its deadline is still
outstanding, so a loop that settles has nothing left to wake for.
Interior-mutable so drivers can request through a shared Res.
Implementations§
Source§impl WakeDeadline
impl WakeDeadline
Sourcepub fn request(&self, at: Instant)
pub fn request(&self, at: Instant)
Ask for a tick no later than at. Keeps the earliest of all requests
made since the last Self::clear.
Sourcepub fn get(&self) -> Option<Instant>
pub fn get(&self) -> Option<Instant>
The earliest instant requested since the last Self::clear.
Sourcepub fn clear(&self)
pub fn clear(&self)
Drop every request. Called by reset_wake_deadline at tick start.
Trait Implementations§
Source§impl Component for WakeDeadline
impl Component for WakeDeadline
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::SparseSet
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::SparseSet
Source§type Mutability = Mutable
type Mutability = Mutable
Component<Mutability = Mutable>,
while immutable components will instead have Component<Mutability = Immutable>. Read moreSource§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Source§fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
ComponentRelationshipAccessor] required for working with relationships in dynamic contexts. Read more§fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
§fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
EntityMapper. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component, this is populated by annotating fields containing entities with #[entities] Read moreSource§impl Debug for WakeDeadline
impl Debug for WakeDeadline
Source§impl Default for WakeDeadline
impl Default for WakeDeadline
Source§fn default() -> WakeDeadline
fn default() -> WakeDeadline
impl Resource for WakeDeadline
Auto Trait Implementations§
impl !Freeze for WakeDeadline
impl RefUnwindSafe for WakeDeadline
impl Send for WakeDeadline
impl Sync for WakeDeadline
impl Unpin for WakeDeadline
impl UnsafeUnpin for WakeDeadline
impl UnwindSafe for WakeDeadline
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
§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ) -> impl Iterator<Item = ComponentId> + use<C>
§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
§unsafe fn get_components(
ptr: MovingPtr<'_, C>,
func: &mut impl FnMut(StorageType, OwningPtr<'_>),
) -> <C as DynamicBundle>::Effect
unsafe fn get_components( ptr: MovingPtr<'_, C>, func: &mut impl FnMut(StorageType, OwningPtr<'_>), ) -> <C as DynamicBundle>::Effect
§unsafe fn apply_effect(
_ptr: MovingPtr<'_, MaybeUninit<C>>,
_entity: &mut EntityWorldMut<'_>,
)
unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit<C>>, _entity: &mut EntityWorldMut<'_>, )
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().