Skip to main content

dope_core/driver/storage/
path.rs

1use std::mem;
2
3use crate::driver::{storage, storage::Path};
4
5/// The path from a storage plan to itself.
6#[derive(Clone, Copy, Default)]
7pub struct Here;
8
9impl<S: storage::Plan> Path<S, S> for Here {
10    fn get<'life, 'p, 'd>(self, root: &'life S::Output<'p, 'd>) -> &'life S::Output<'p, 'd>
11    where
12        'd: 'p,
13        'p: 'life,
14        'd: 'life,
15        Self: 'd,
16        S: 'd,
17    {
18        root
19    }
20}
21
22const _: () = {
23    assert!(mem::size_of::<Here>() == 0);
24    assert!(mem::align_of::<Here>() == 1);
25    assert!(!mem::needs_drop::<Here>());
26};