pub trait Interface {
const HW_MTU: usize;
const KIND: InterfaceKind;
// Required methods
fn channel_tag(&self) -> &[u8] ⓘ;
fn descriptor(&self) -> InterfaceDescriptor;
async fn run<S: InterfaceSeam>(self, seam: S);
}Required Associated Constants§
const HW_MTU: usize
Sourceconst KIND: InterfaceKind
const KIND: InterfaceKind
The medium this interface speaks, which is also the namespace root of its id (from_channel_tag).
Required Methods§
Sourcefn channel_tag(&self) -> &[u8] ⓘ
fn channel_tag(&self) -> &[u8] ⓘ
There is one hard contract for channel_tag(): distinct bytes across distinct concurrent communication channels, and the same bytes across every reconnect and reboot for that effective channel.
The tag names which channel of this medium the interface is: e.g., a TCP host:port, a BLE peer MAC, a LoRa frequency + modulation profile. InterfaceId::from_channel_tag hashes it into this interface’s id ([KIND] ++ sha256(tag)[..7]), the engine’s entire notion of the interface: routes, links, and the departure grace all key on it. Same tag means the re-attached interface is the old one and its routes survive; a shared tag would fuse two distinct live channels into the same id.
fn descriptor(&self) -> InterfaceDescriptor
async fn run<S: InterfaceSeam>(self, seam: S)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".