rel_ptr/fmt.rs
1use super::*;
2
3use std::fmt::*;
4
5impl<T: ?Sized + MetaData, I: Debug + Delta> Pointer for RelPtr<T, I> {
6 fn fmt(&self, f: &mut Formatter<'_>) -> Result {
7 write!(f, "{:p}({:?})", self, self.0)
8 }
9}
10
11impl<T: ?Sized + MetaData, I: Debug + Delta> Debug for RelPtr<T, I> {
12 fn fmt(&self, f: &mut Formatter<'_>) -> Result {
13 f.debug_struct("RelPtr")
14 .field("ptr", &(self as *const Self))
15 .field("offset", &self.0)
16 .finish()
17 }
18}