pub struct RectRefresh { /* private fields */ }Expand description
A payload-type-erased “re-measure your zones” channel, shared by every registry under one provider tree.
Cached client rects go stale the moment layout moves under a live drag - scrolling being the everyday case. Registries are per payload type, but the things that move layout (an auto-scrolling container, your own scroll surface, a collapsing panel) shouldn’t need to know any payload type to say “geometry changed”. Each provider registers a thunk here that re-measures its own registry only while it has a drag in flight, so pinging the channel from every scroll event costs nothing while idle.
crate::autoscroll::AutoScroll pings this automatically after every
scroll it performs (and on any other scroll of its container); grab the
channel with crate::core::hooks::use_rect_refresh to wire up custom
layout mutators.
Implementations§
Source§impl RectRefresh
impl RectRefresh
Sourcepub fn from_signal(thunks: Signal<Vec<(u64, Callback<()>)>>) -> Self
pub fn from_signal(thunks: Signal<Vec<(u64, Callback<()>)>>) -> Self
Wrap an existing signal. Prefer crate::core::hooks::use_dnd_provider,
which creates one per provider tree (nested providers inherit and
re-provide the outermost channel).
Sourcepub fn refresh_all(&self)
pub fn refresh_all(&self)
Ask every provider in the tree to re-measure its zones. Providers without a drag in flight ignore the ping, so this is safe to call from high-frequency sources like scroll events.
Trait Implementations§
Source§impl Clone for RectRefresh
impl Clone for RectRefresh
impl Copy for RectRefresh
Auto Trait Implementations§
impl !RefUnwindSafe for RectRefresh
impl !Send for RectRefresh
impl !Sync for RectRefresh
impl !UnwindSafe for RectRefresh
impl Freeze for RectRefresh
impl Unpin for RectRefresh
impl UnsafeUnpin for RectRefresh
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more