drawbridge_server/store/tree.rs
1// SPDX-FileCopyrightText: 2022 Profian Inc. <opensource@profian.com>
2// SPDX-License-Identifier: Apache-2.0
3
4use super::Entity;
5
6use std::ops::Deref;
7
8use camino::Utf8PathBuf;
9
10#[repr(transparent)]
11#[derive(Copy, Clone, Debug)]
12pub struct Node<'a, P = Utf8PathBuf>(Entity<'a, P>);
13
14impl<'a, P> Deref for Node<'a, P> {
15 type Target = Entity<'a, P>;
16
17 fn deref(&self) -> &Self::Target {
18 &self.0
19 }
20}
21
22impl<'a, P> From<Entity<'a, P>> for Node<'a, P> {
23 fn from(entity: Entity<'a, P>) -> Self {
24 Self(entity)
25 }
26}