[−][src]Struct object_controller_tracker::Tracker
An object used to keep track of controller parts of object-controller pairs.
Methods
impl<C> Tracker<C>
[src]
pub fn new() -> Tracker<C>
[src]
Create a new tracker.
pub fn track<T>(&self, object: T, controller: C) -> Tracked<T, C>
[src]
Register an object-controller pair.
The controller part is kept in the Tracker, and the object part is wrapped in a Tracked. When the Tracked object is dropped, the controller is dropped too.
pub fn track_pair<T>(&self, pair: (T, C)) -> Tracked<T, C>
[src]
Register an object-contoller pair.
Same as track(pair.0, pair.1).
pub fn lock(&mut self) -> TrackerGuard<C>
[src]
Lock the tracker so that one can iterate over its controllers.
pub fn for_each<F: FnMut(&C)>(&mut self, f: F)
[src]
Call a closure on each tracked controller. The closure must not register a new controller in this tracker, or drop a tracked object. The controllers are visited in an unspecified order.
Trait Implementations
impl<C> Clone for Tracker<C>
[src]
fn clone(&self) -> Tracker<C>
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<C> Default for Tracker<C>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,