raphtory_api/inherit.rs
1use std::ops::Deref;
2
3/// Get a base for inheriting methods
4pub trait Base {
5 type Base: ?Sized;
6
7 fn base(&self) -> &Self::Base;
8}
9
10/// Deref implies Base
11impl<T: Deref> Base for T {
12 type Base = T::Target;
13
14 #[inline(always)]
15 fn base(&self) -> &Self::Base {
16 self.deref()
17 }
18}