Trait GetSizeTracker

Source
pub trait GetSizeTracker {
    // Required method
    fn track<A: Any + 'static, B>(
        &mut self,
        addr: *const B,
        strong_ref: A,
    ) -> bool;
}
Expand description

A tracker which makes sure that shared ownership objects are only accounted for once.

Required Methods§

Source

fn track<A: Any + 'static, B>(&mut self, addr: *const B, strong_ref: A) -> bool

Tracks a given strong shared ownership object strong_ref of type A, which points to an arbitrary object located at addr.

Returns true if the reference, as indexed by the pointed to addr, has not yet been seen by this tracker. Otherwise it returns false.

If the addr has not yet been seen, the tracker MUST store the strong_ref object to ensure that the addr pointed to by it remains valid for the trackers lifetime.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: GetSizeTracker> GetSizeTracker for &mut T

Source§

fn track<A: Any + 'static, B>(&mut self, addr: *const B, strong_ref: A) -> bool

Source§

impl<T: GetSizeTracker> GetSizeTracker for Box<T>

Source§

fn track<A: Any + 'static, B>(&mut self, addr: *const B, strong_ref: A) -> bool

Source§

impl<T: GetSizeTracker> GetSizeTracker for Arc<Mutex<T>>

Source§

fn track<A: Any + 'static, B>(&mut self, addr: *const B, strong_ref: A) -> bool

Source§

impl<T: GetSizeTracker> GetSizeTracker for Arc<RwLock<T>>

Source§

fn track<A: Any + 'static, B>(&mut self, addr: *const B, strong_ref: A) -> bool

Source§

impl<T: GetSizeTracker> GetSizeTracker for Mutex<T>

Source§

fn track<A: Any + 'static, B>(&mut self, addr: *const B, strong_ref: A) -> bool

Source§

impl<T: GetSizeTracker> GetSizeTracker for RwLock<T>

Source§

fn track<A: Any + 'static, B>(&mut self, addr: *const B, strong_ref: A) -> bool

Implementors§