pub struct Polled<T> {
pub value: T,
pub revision: RevisionCounter,
}Expand description
Result of polling a query, containing the value and its revision.
This is returned by QueryRuntime::poll and provides both the query result
and its change revision, enabling efficient change detection for subscription
patterns.
§Example
ⓘ
let result = runtime.poll(MyQuery::new())?;
// Access the value via Deref
println!("{:?}", *result);
// Check if changed since last poll
if result.revision > last_known_revision {
notify_subscribers(&result.value);
last_known_revision = result.revision;
}Fields§
§value: TThe query result value.
revision: RevisionCounterThe revision at which this value was last changed.
Compare this with a previously stored revision to detect changes.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Polled<T>where
T: Freeze,
impl<T> RefUnwindSafe for Polled<T>where
T: RefUnwindSafe,
impl<T> Send for Polled<T>where
T: Send,
impl<T> Sync for Polled<T>where
T: Sync,
impl<T> Unpin for Polled<T>where
T: Unpin,
impl<T> UnwindSafe for Polled<T>where
T: UnwindSafe,
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