id_sys 0.1.0

Provides data structures which can be marked such that they only work with similarly marked integer data types.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::{internal::Sealed, IdPtr};

pub trait PtrExt<TValue>: Sealed {
    fn to_id_ptr<TMarker: ?Sized>(self) -> IdPtr<TMarker, TValue>;
}

impl<TValue> PtrExt<TValue> for *const TValue {
    fn to_id_ptr<TMarker: ?Sized>(self) -> IdPtr<TMarker, TValue> {
        IdPtr::from_ptr(self)
    }
}