pub struct HandlerList<F>where
F: ?Sized,{ /* private fields */ }Expand description
A list of event handlers that tolerates being modified while it is being invoked: invocation works on a snapshot, and the snapshot is only copied when the list actually changes.
Implementations§
Source§impl<F> HandlerList<F>where
F: ?Sized,
impl<F> HandlerList<F>where
F: ?Sized,
pub fn new() -> HandlerList<F>
A list whose tokens come from ids, a counter shared with other
lists: tokens across all of them increase in subscription order.
Sourcepub fn with_ordered_ids() -> HandlerList<F>
pub fn with_ordered_ids() -> HandlerList<F>
A list whose tokens come from the counter of the process, which every
list made this way shares: tokens across all of them increase in
subscription order, as with with_shared_ids,
without a counter to allocate.
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Sourcepub fn add(&self, handler: Rc<F>) -> u64
pub fn add(&self, handler: Rc<F>) -> u64
Adds a handler and returns a token that removes it again.
Sourcepub fn snapshot(&self) -> HandlerSnapshot<F>
pub fn snapshot(&self) -> HandlerSnapshot<F>
Returns the current handlers; later modifications do not affect it.
Trait Implementations§
Source§impl<F> Default for HandlerList<F>where
F: ?Sized,
impl<F> Default for HandlerList<F>where
F: ?Sized,
Source§fn default() -> HandlerList<F>
fn default() -> HandlerList<F>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<F> !Freeze for HandlerList<F>
impl<F> !RefUnwindSafe for HandlerList<F>
impl<F> !Send for HandlerList<F>
impl<F> !Sync for HandlerList<F>
impl<F> !UnwindSafe for HandlerList<F>
impl<F> Unpin for HandlerList<F>
impl<F> UnsafeUnpin for HandlerList<F>
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more