pub struct TrackedObject<T> { /* fields omitted */ }
Your tracked object.
A tracked object contains reference counting logic and an
Arc
to your object.
It is cloneable but calling clone will not clone
your internal object.
Your object cannot be mutated. You can borrow it using
the Deref
interface.
Creates a new object from an existing one.
The new object will be registered
in your original object's inventory.
let inventory = Inventory::new();
let seven = inventory.track(7);
let fourteen = seven.map(|i| i * 2);
assert_eq!(*fourteen, 14);
let living_instances = inventory.list();
assert_eq!(living_instances.len(), 2);
Performs copy-assignment from source
. Read more
Executes the destructor for this type. Read more
The resulting type after dereferencing.
Immutably borrows from an owned value. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)