1use crate::libc_types::c_int;
2use std::marker::PhantomData;
3
4pub struct Index<T, U>(c_int, PhantomData<(T, U)>);
9
10impl<T, U> Copy for Index<T, U> {}
11
12impl<T, U> Clone for Index<T, U> {
13 fn clone(&self) -> Index<T, U> {
14 *self
15 }
16}
17
18impl<T, U> Index<T, U> {
19 #[must_use]
25 pub unsafe fn from_raw(idx: c_int) -> Index<T, U> {
26 Index(idx, PhantomData)
27 }
28
29 #[allow(clippy::trivially_copy_pass_by_ref)]
30 #[must_use]
31 pub fn as_raw(&self) -> c_int {
32 self.0
33 }
34}