nodecraft/
address.rs

1use core::fmt::{Debug, Display};
2
3use cheap_clone::CheapClone;
4
5/// Host address type alias
6#[cfg(feature = "hostaddr")]
7#[cfg_attr(docsrs, doc(cfg(feature = "hostaddr")))]
8pub type HostAddr = hostaddr::HostAddr<smol_str_0_3::SmolStr>;
9
10/// Domain type alias
11#[cfg(feature = "hostaddr")]
12#[cfg_attr(docsrs, doc(cfg(feature = "hostaddr")))]
13pub type Domain = hostaddr::Domain<smol_str_0_3::SmolStr>;
14
15/// Host address type alias
16#[cfg(feature = "hostaddr")]
17#[cfg_attr(docsrs, doc(cfg(feature = "hostaddr")))]
18pub type HostAddrBuffer = hostaddr::HostAddr<hostaddr::Buffer>;
19
20/// Domain type alias
21#[cfg(feature = "hostaddr")]
22#[cfg_attr(docsrs, doc(cfg(feature = "hostaddr")))]
23pub type DomainBuffer = hostaddr::Domain<hostaddr::Buffer>;
24
25#[cfg(feature = "hostaddr")]
26#[cfg_attr(docsrs, doc(cfg(feature = "hostaddr")))]
27pub use hostaddr;
28
29/// Address abstraction for distributed systems
30pub trait Address:
31  CheapClone + Eq + Ord + core::hash::Hash + Debug + Display + Sized + Unpin + 'static
32{
33}
34
35impl<T> Address for T where
36  T: CheapClone + Eq + Ord + core::hash::Hash + Debug + Display + Sized + Unpin + 'static
37{
38}