pub struct DragPayloadRegistry { /* private fields */ }Expand description
Zero-overhead TableSlot-indexed registry of DragPayloadContributor hooks (32 B inline
when empty; 1 branch and 0 heap allocations on the empty fast path).
Implementations§
Source§impl DragPayloadRegistry
impl DragPayloadRegistry
Sourcepub fn register(
&mut self,
slot: TableSlot,
contributor: Arc<dyn DragPayloadContributor>,
) -> bool
pub fn register( &mut self, slot: TableSlot, contributor: Arc<dyn DragPayloadContributor>, ) -> bool
Registers contributor at slot, returning true if a prior contributor at slot was
replaced.
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Sourcepub fn contribute(&self, store: &NodeStore, node: NodeId) -> Option<DragPayload>
pub fn contribute(&self, store: &NodeStore, node: NodeId) -> Option<DragPayload>
Queries registered contributors matching node’s attached tables in registration order,
returning the first Some(DragPayload). Empty registry exits in 1 branch with 0 allocs.
Sourcepub fn resolve_internal_payload(
&self,
store: &NodeStore,
node: NodeId,
explicit_mime: &str,
explicit_data: &str,
) -> DragPayload
pub fn resolve_internal_payload( &self, store: &NodeStore, node: NodeId, explicit_mime: &str, explicit_data: &str, ) -> DragPayload
Resolves a drag-start DragPayload for node: non-empty explicit_data takes
precedence via build_internal_drag_payload; otherwise registered contributors are
queried before falling back to [build_internal_drag_payload(explicit_mime, explicit_data)].
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DragPayloadRegistry
impl !UnwindSafe for DragPayloadRegistry
impl Forget for DragPayloadRegistry
impl Freeze for DragPayloadRegistrywhere
*const SlotStorage<Arc<dyn DragPayloadContributor>> is !null: Freeze,
PhantomData<SlotStorage<Arc<dyn DragPayloadContributor>>>: Freeze,
impl Move for DragPayloadRegistry
impl Send for DragPayloadRegistry
impl Sync for DragPayloadRegistry
impl Unpin for DragPayloadRegistry
impl UnsafeUnpin for DragPayloadRegistrywhere
*const SlotStorage<Arc<dyn DragPayloadContributor>> is !null: UnsafeUnpin,
PhantomData<SlotStorage<Arc<dyn DragPayloadContributor>>>: UnsafeUnpin,
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