rshyper_core/rel/impls/
impl_link_ext.rs

1/*
2    appellation: impl_link_ext <module>
3    authors: @FL03
4*/
5use crate::idx::{EdgeId, RawIndex};
6use crate::rel::{Layout, Link, RawLayout};
7use crate::{Domain, GraphType};
8
9impl<S, K, Idx> RawLayout for Link<S, K, Idx>
10where
11    Idx: RawIndex,
12    K: GraphType,
13    S: Domain<Idx>,
14{
15    type Kind = K;
16    type Index = Idx;
17    type Store = S;
18
19    seal!();
20
21    fn index(&self) -> &EdgeId<Idx> {
22        self.id()
23    }
24
25    fn domain(&self) -> &S {
26        self.domain()
27    }
28
29    fn domain_mut(&mut self) -> &mut S {
30        self.domain_mut()
31    }
32}
33
34impl<S, K, Idx> Layout for Link<S, K, Idx>
35where
36    S: Domain<Idx>,
37    Idx: RawIndex,
38    K: GraphType,
39{
40    fn new(id: EdgeId<Idx>, vertices: S) -> Self {
41        Self::new(id, vertices)
42    }
43}