Filament
Interfaces
Shared interfaces in Filament — common traits and types that link, transport, and core implementations depend on.
Purpose
Experimental transport/runtime stack composed from filament core, crypto, link, packet, transport, types, interfaces, and utilities.
This page follows the real source shape for Filament and explains the workflow a developer is likely to use first.
Developer workflow
Start from the smallest constructor or builder, perform one meaningful operation, inspect the returned state, then add the relevant policy, storage, or network integration. The examples below should be expanded whenever the crate API changes.
Primary types to know
Announce— filament/filament-transport/src/announce.rsAnnounceManager— filament/filament-transport/src/announce.rsAnnounceQueue— filament/filament-transport/src/announce.rsAutoInterface— filament/filament-interfaces/src/auto.rsAutoInterfaceBuilder— filament/filament-interfaces/src/auto.rsAutoInterfaceConfig— filament/filament-interfaces/src/auto.rsBandwidthManager— filament/filament-transport/src/bandwidth.rsChannel— filament/filament-link/src/channel.rsChannelMessage— filament/filament-link/src/channel.rsConfig— filament/filament-core/src/config.rsDestinationHash— filament/filament-transport/src/types.rsDestinationHash— filament/filament-types/src/primitives.rs
Example shape
use filament_interfaces::{
InterfaceManager, TCPClientConfig, TCPClientInterface, UDPInterface, UDPInterfaceConfig,
};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Each interface implementation produces a typed config object and registers
// itself with the InterfaceManager. The manager owns the read/write loops.
let mut manager = InterfaceManager::new();
let tcp = TCPClientInterface::new(TCPClientConfig {
peer_addr: "198.51.100.7:4040".parse()?,
keepalive_secs: Some(30),
..TCPClientConfig::default()
})?;
let udp = UDPInterface::new(UDPInterfaceConfig {
bind_addr: "0.0.0.0:0".parse()?,
..UDPInterfaceConfig::default()
})?;
manager.register(Box::new(tcp)).await?;
manager.register(Box::new(udp)).await?;
println!("registered interfaces: {}", manager.len());
Ok(())
}