feat: graph (WIP)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use std::{marker::PhantomPinned, ops::Deref};
|
||||
use std::{marker::PhantomPinned, ops::{Deref, DerefMut}};
|
||||
|
||||
use bumpalo::{Bump, boxed::Box};
|
||||
use hashbrown::HashMap;
|
||||
@@ -32,6 +32,12 @@ struct Pin<'bump, T> {
|
||||
_marker: PhantomPinned,
|
||||
}
|
||||
|
||||
impl<T> Pin<'_, T> {
|
||||
fn into_inner(self) -> T {
|
||||
Box::into_inner(self.ptr)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Deref for Pin<'_, T> {
|
||||
type Target = T;
|
||||
fn deref(&self) -> &Self::Target {
|
||||
@@ -39,6 +45,12 @@ impl<T> Deref for Pin<'_, T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> DerefMut for Pin<'_, T> {
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
self.ptr.as_mut()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'bump, T> Pin<'bump, T> {
|
||||
fn new_in(x: T, bump: &'bump Bump) -> Self {
|
||||
Self {
|
||||
|
||||
Reference in New Issue
Block a user