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 new(id: ZoneId, on_drop: Callback<DropOutcome<T>>) -> Self
pub fn new(id: ZoneId, on_drop: Callback<DropOutcome<T>>) -> Self
Create a zone record with permissive default acceptance policy.
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
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
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