pub struct InvalidationRecord { /* private fields */ }Expand description
One bounded provenance record for an invalidation request.
Records are immutable snapshots. Sequence values start at one and saturate
at u64::MAX; they can therefore cease being unique only after saturation.
was_coalesced says an element already had pending work, not that the new
request had the same strength.
§Examples
use ailloli_ui_core::ElementId;
use ailloli_ui_runtime::app::{Invalidation, InvalidationSource, RuntimeHandle};
let handle = RuntimeHandle::<()>::new();
handle.invalidate_from(ElementId(7), Invalidation::Layout, InvalidationSource::Event);
let snapshot = handle.invalidation_diagnostics();
assert_eq!(snapshot.records.len(), 1);
assert_eq!(snapshot.records[0].element_id(), ElementId(7));Implementations§
Source§impl InvalidationRecord
Provides the operations defined for InvalidationRecord.
impl InvalidationRecord
Provides the operations defined for InvalidationRecord.
Sourcepub const fn sequence(&self) -> u64
pub const fn sequence(&self) -> u64
Returns the one-based saturating request sequence.
§Examples
use ailloli_ui_core::ElementId;
use ailloli_ui_runtime::app::{Invalidation, RuntimeHandle};
let handle = RuntimeHandle::<()>::new();
handle.invalidate(ElementId(1), Invalidation::Paint);
assert_eq!(handle.invalidation_diagnostics().records[0].sequence(), 1);Sourcepub const fn element_tree_id(&self) -> ElementTreeId
pub const fn element_tree_id(&self) -> ElementTreeId
Returns the retained-tree namespace that received the request.
§Examples
use ailloli_ui_core::ElementId;
use ailloli_ui_runtime::app::{Invalidation, RuntimeHandle};
let handle = RuntimeHandle::<()>::new();
handle.invalidate(ElementId(1), Invalidation::Paint);
assert_eq!(handle.invalidation_diagnostics().records[0].element_tree_id(), handle.element_tree_id());Sourcepub const fn element_id(&self) -> ElementId
pub const fn element_id(&self) -> ElementId
Returns the tree-local target element ID.
§Examples
use ailloli_ui_core::ElementId;
use ailloli_ui_runtime::app::{Invalidation, RuntimeHandle};
let handle = RuntimeHandle::<()>::new();
handle.invalidate(ElementId(9), Invalidation::Paint);
assert_eq!(handle.invalidation_diagnostics().records[0].element_id(), ElementId(9));Sourcepub const fn invalidation(&self) -> Invalidation
pub const fn invalidation(&self) -> Invalidation
Returns the requested retained-work strength before coalescing.
§Examples
use ailloli_ui_core::ElementId;
use ailloli_ui_runtime::app::{Invalidation, RuntimeHandle};
let handle = RuntimeHandle::<()>::new();
handle.invalidate(ElementId(1), Invalidation::Build);
assert_eq!(handle.invalidation_diagnostics().records[0].invalidation(), Invalidation::Build);Sourcepub const fn source(&self) -> InvalidationSource
pub const fn source(&self) -> InvalidationSource
Returns the diagnostic origin supplied by the caller.
§Examples
use ailloli_ui_core::ElementId;
use ailloli_ui_runtime::app::{Invalidation, InvalidationSource, RuntimeHandle};
let handle = RuntimeHandle::<()>::new();
handle.invalidate_from(ElementId(1), Invalidation::Paint, InvalidationSource::Model);
assert_eq!(handle.invalidation_diagnostics().records[0].source(), InvalidationSource::Model);Sourcepub const fn was_coalesced(&self) -> bool
pub const fn was_coalesced(&self) -> bool
Returns whether the target already had a pending invalidation.
The first request is false; subsequent requests before pending work is taken are true even when they strengthen the retained-work level.
§Examples
use ailloli_ui_core::ElementId;
use ailloli_ui_runtime::app::{Invalidation, RuntimeHandle};
let handle = RuntimeHandle::<()>::new();
handle.invalidate(ElementId(1), Invalidation::Paint);
handle.invalidate(ElementId(1), Invalidation::Build);
let records = handle.invalidation_diagnostics().records;
assert!(!records[0].was_coalesced());
assert!(records[1].was_coalesced());Trait Implementations§
Source§impl Clone for InvalidationRecord
impl Clone for InvalidationRecord
Source§fn clone(&self) -> InvalidationRecord
fn clone(&self) -> InvalidationRecord
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InvalidationRecord
impl Debug for InvalidationRecord
Source§impl PartialEq for InvalidationRecord
impl PartialEq for InvalidationRecord
impl Copy for InvalidationRecord
impl Eq for InvalidationRecord
impl StructuralPartialEq for InvalidationRecord
Auto Trait Implementations§
impl Freeze for InvalidationRecord
impl RefUnwindSafe for InvalidationRecord
impl Send for InvalidationRecord
impl Sync for InvalidationRecord
impl Unpin for InvalidationRecord
impl UnwindSafe for InvalidationRecord
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
Source§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.