pub struct ZoneRecord<T: Clone + 'static> {
pub id: ZoneId,
pub parent: Option<ZoneId>,
pub label: Option<String>,
pub on_drop: Callback<DropOutcome<T>>,
pub accepts: Option<Callback<T, bool>>,
pub mounted: Option<Rc<MountedData>>,
pub rect: Option<Rect>,
}Expand description
One registered drop zone.
Fields§
§id: ZoneId§parent: Option<ZoneId>The enclosing zone, when this zone is nested inside another
DropZone (discovered automatically via context).
label: Option<String>Human label used in screen-reader announcements.
on_drop: Callback<DropOutcome<T>>Delivers a completed drop to the zone’s owner.
accepts: Option<Callback<T, bool>>The zone’s acceptance filter, if any.
mounted: Option<Rc<MountedData>>The zone’s mounted element, once available. This plain value lives in
the provider-owned registry storage; zones update it through
ZoneRegistry::set_mounted.
rect: Option<Rect>Cached client rect (refreshed via ZoneRegistry::refresh_rects).
This plain value lives in the provider-owned registry storage; zones
update it through ZoneRegistry::set_rect_if_present.
Implementations§
Source§impl<T: Clone + 'static> ZoneRecord<T>
impl<T: Clone + 'static> ZoneRecord<T>
Sourcepub fn accepts_payload(&self, payload: &T) -> bool
pub fn accepts_payload(&self, payload: &T) -> bool
Does this zone accept the payload?
Sourcepub fn cached_rect(&self) -> Option<Rect>
pub fn cached_rect(&self) -> Option<Rect>
The cached client rect in this registry snapshot.
Sourcepub fn mounted_handle(&self) -> Option<Rc<MountedData>>
pub fn mounted_handle(&self) -> Option<Rc<MountedData>>
The mounted element in this registry snapshot.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for ZoneRecord<T>
impl<T> !Send for ZoneRecord<T>
impl<T> !Sync for ZoneRecord<T>
impl<T> !UnwindSafe for ZoneRecord<T>
impl<T> Freeze for ZoneRecord<T>
impl<T> Unpin for ZoneRecord<T>
impl<T> UnsafeUnpin for ZoneRecord<T>
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
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,
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
Create an instance of this type from an initialization function
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.