filament-transport · forwarding
Source declarations, signatures and documentation for forwarding.
Read the current implementation boundaries before integration. This reference reproduces declarations; it omits source comments whose examples or readiness claims have not been verified.
Source: sigil/weave/filament/filament-transport/src/forwarding.rs. SHA-256: 9514181d221092f4cf3ccaa35017a41cedc1e436fb17221e71f7807b462cdfc1.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
forwarding::HopInfo
#[derive(Debug, Clone)]
pub struct HopInfo {
/// Destination the packet is heading to.
pub destination: DestinationHash,
/// Current hop count.
pub hops: u8,
/// Maximum hops allowed (TTL).
pub max_hops: u8,
/// Packet hash for loop detection.
pub packet_hash: [u8; 32]
}Source line: 21.
forwarding::HopInfo::new
#[must_use]
pub fn new(destination: DestinationHash, max_hops: u8, packet_hash: [u8; 32]) -> Self;Source line: 38.
forwarding::HopInfo::increment
pub fn increment(&mut self) -> Result<()>;Source line: 52.
forwarding::HopInfo::is_expired
#[must_use]
pub fn is_expired(&self) -> bool;Source line: 62.
forwarding::HopInfo::remaining_hops
#[must_use]
pub fn remaining_hops(&self) -> u8;Source line: 68.
forwarding::ForwardingDecision
#[derive(Debug, Clone)]
pub enum ForwardingDecision {
/// Deliver locally (this is the destination).
Deliver,
/// Forward to next hop.
Forward {
/// Next hop destination.
next_hop: DestinationHash,
/// Interface to use.
interface: InterfaceId,
/// Updated hop info.
hop_info: HopInfo,
},
/// Drop the packet.
Drop(ForwardingDropReason),
}Source line: 128.
forwarding::ForwardingDropReason
#[derive(Debug, Clone)]
pub enum ForwardingDropReason {
/// TTL expired (hop count reached max).
TtlExpired,
/// Loop detected.
LoopDetected,
/// No path to destination.
NoPath,
/// Interface mode doesn't support transport.
TransportDisabled,
/// Invalid hop count.
InvalidHopCount,
}Source line: 148.
forwarding::ForwardingEngine
pub struct ForwardingEngine {
}Source line: 178.
forwarding::ForwardingEngine::new
#[must_use]
pub fn new(routing_table: Arc<RoutingTable>, interface_mode: InterfaceMode) -> Self;Source line: 195.
forwarding::ForwardingEngine::decide
pub async fn decide(
&self,
destination: DestinationHash,
mut hop_info: HopInfo,
is_local: bool,
) -> ForwardingDecision;Source line: 211.
forwarding::ForwardingEngine::cleanup
pub async fn cleanup(&self);Source line: 272.
forwarding::ForwardingEngine::set_max_hops
pub fn set_max_hops(&mut self, max_hops: u8);Source line: 278.
forwarding::ForwardingEngine::interface_mode
#[must_use]
pub fn interface_mode(&self) -> InterfaceMode;Source line: 284.
forwarding::ForwardingEngine::set_interface_mode
pub fn set_interface_mode(&mut self, mode: InterfaceMode);Source line: 289.