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::Pending
means this hook’s inner state is not updated after the lastuse_hook
. The executor DO NOT NEED to calluse_hook
again because the returned value is expected to remain the same as the value from the last call. The executor CAN still calluse_hook
to 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_hook
again 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_hook
or even drop this hook. The executor CAN also calluse_hook
to get the value and the hook MIGHT become dynamic again duringuse_hook
or when some operations is done to the returned value.