Function std::mem::snapshot

Overview
fn snapshot(value: any) -> Option

Get the usage snapshot of a value.

A snapshot can be used to diagnose how many users a given value has.

Examples

use std::mem::snapshot;

let v1 = [1, 2, 3];
let a = snapshot(v1)?;
let v2 = [v1];
let b = snapshot(v1)?;

assert_eq!(a.shared(), 0);
assert_eq!(b.shared(), 0);

dbg!(a);
dbg!(b);