Trait hooks_core::HookPollNextUpdate
source · pub trait HookPollNextUpdate {
fn poll_next_update(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<bool>;
}Required Methods§
sourcefn poll_next_update(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<bool>
fn poll_next_update(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<bool>
The meaning of the return value is:
-
Poll::Pendingmeans this hook’s inner state is not updated after the lastuse_hook. The executor DO NOT NEED to calluse_hookagain because the returned value is expected to remain the same as the value from the last call. The executor CAN still calluse_hookto re-get the returned value. -
Poll::Ready(true)means this hook’s inner state has been updated since the lastuse_hook. The executor SHOULD calluse_hookagain to get the new value. The executor CAN ignore this update, by polling next update without callinguse_hook. -
Poll::Ready(false)means this hook’s inner state will never be updated. The executor CAN no longer calluse_hookor even drop this hook. The executor CAN also calluse_hookto get the value and the hook MIGHT become dynamic again duringuse_hookor when some operations is done to the returned value.