1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use std::ffi::c_void;
use std::marker::PhantomData;

use crate::traits::Boxed;

pub struct AbstractRefMut<'r, T: ?Sized> {
	ptr: *mut c_void,
	_d: PhantomData<&'r mut T>,
}

impl<T: ?Sized> Boxed for AbstractRefMut<'_, T> {
	#[inline]
	unsafe fn from_raw(ptr: *mut c_void) -> Self {
		Self { ptr, _d: PhantomData }
	}

	#[inline]
	fn into_raw(self) -> *mut c_void {
		self.ptr
	}

	#[inline]
	fn as_raw(&self) -> *const c_void {
		self.ptr
	}

	#[inline]
	fn as_raw_mut(&mut self) -> *mut c_void {
		self.ptr
	}
}