ref_wrapper 0.1.4

Wrapper of dynamically borrowed data.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::drop_tracer::DropTracer;

pub struct DropItem<'a> {
    tracer: &'a DropTracer,
}

impl<'a> DropItem<'a> {
    pub(super) fn new(tracer: &'a DropTracer) -> Self {
        Self { tracer }
    }
}

impl Drop for DropItem<'_> {
    fn drop(&mut self) {
        self.tracer.drop_item()
    }
}