dreck 0.1.1

A safe tracing garbage collection library with minimal safety bookkeeping
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Marker types used by dreck.

use core::marker::PhantomData;

/// A struct which allows marking a lifetime as invariant.
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Invariant<'inv>(PhantomData<&'inv mut &'inv fn(&'inv ()) -> &'inv ()>);

impl<'inv> Invariant<'inv> {
    pub fn new() -> Self {
        Invariant(PhantomData)
    }
}