pub struct TestDrop { /* private fields */ }
Expand description
A struct to help test drop related issues.
See the module documentation for examples of usage.
Implementations§
Source§impl TestDrop
impl TestDrop
Sourcepub fn new_item(&self) -> (usize, Item<'_>)
pub fn new_item(&self) -> (usize, Item<'_>)
Creates a new Item
and returns the id
of the item and the item.
The id
of the item can be used with assert_drop
and assert_no_drop
.
Sourcepub fn num_tracked_items(&self) -> usize
pub fn num_tracked_items(&self) -> usize
Returns the number of tracked items.
Sourcepub fn num_dropped_items(&self) -> usize
pub fn num_dropped_items(&self) -> usize
Returns the number of dropped items so far.
Sourcepub fn assert_drop(&self, id: usize)
pub fn assert_drop(&self, id: usize)
Sourcepub fn assert_no_drop(&self, id: usize)
pub fn assert_no_drop(&self, id: usize)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TestDrop
impl !RefUnwindSafe for TestDrop
impl Send for TestDrop
impl !Sync for TestDrop
impl Unpin for TestDrop
impl UnwindSafe for TestDrop
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more