1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use crate::Hybrid;
use crate::LinkType;
use funty::Integral;
use std::ops::Sub;

#[derive(Default)]
pub struct AddrToRaw;

impl AddrToRaw {
    pub const fn convert<T: LinkType + ~const Integral + ~const Sub>(&self, source: T) -> T {
        Hybrid::external(source).as_inner()
    }
}

#[derive(Default)]
pub struct RawToAddr;

impl RawToAddr {
    pub const fn convert<T: LinkType + ~const Integral + ~const Sub>(&self, source: T) -> T {
        Hybrid::external(source).abs()
    }
}