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§
Sourcefn track<A: Any + 'static, B>(&mut self, addr: *const B, strong_ref: A) -> bool
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.