use core::fmt::Debug;
use core::hash::Hash;
#[cfg(feature = "std")]
use super::PrefixSet;
use super::{
primitive, Address, Bitmask, Hostmask, Interface, Netmask, Prefix, PrefixLength, PrefixRange,
};
use crate::{any, concrete, fmt};
pub trait Afi: Copy + Debug + Hash + Ord + 'static {
type Octets: primitive::Octets;
type Primitive: primitive::Address<Self> + fmt::AddressDisplay<Self>;
fn as_afi() -> concrete::Afi;
}
pub trait AfiClass: Copy + Debug + Hash + Ord {
type Address: Address;
type Netmask: Netmask;
type Hostmask: Hostmask;
type Bitmask: Bitmask;
type PrefixLength: PrefixLength + Into<Self::Netmask> + Into<Self::Hostmask>;
type Prefix: Prefix<Address = Self::Address, Length = Self::PrefixLength, Netmask = Self::Netmask>
+ Into<Self::PrefixRange>;
type Interface: Interface<
Address = Self::Address,
Prefix = Self::Prefix,
PrefixLength = Self::PrefixLength,
>;
type PrefixRange: PrefixRange<Prefix = Self::Prefix, Length = Self::PrefixLength>;
#[cfg(feature = "std")]
type PrefixSet: for<'a> PrefixSet<'a, Prefix = Self::Prefix, Range = Self::PrefixRange>;
fn as_afi_class() -> any::AfiClass;
}