Weave documentation
Filament referencefilament-link

filament-link · state

Source declarations, signatures and documentation for state.

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-link/src/state.rs. SHA-256: e0038120ddd1b2d8b34101e91582c69725e7ea513e17c9cec7dda540a32746e2.

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.

state::LinkStatus

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum LinkStatus {
    /// Link request sent, awaiting proof
    Pending,

    /// Link proof received, awaiting confirmation
    ProofReceived,

    /// Link fully established and active
    Active,

    /// Link is stale (no activity)
    Stale,

    /// Link closed gracefully
    Closed,

    /// Link failed (error occurred)
    Failed,
}

Source line: 12.

state::LinkState

#[derive(Debug, Clone)]
pub struct LinkState {
/// Link ID

pub link_id: LinkId,
/// Current status

pub status: LinkStatus,
/// Creation timestamp

pub created_at: Instant,
/// Last activity timestamp

pub last_activity: Instant,
/// Initiator's ephemeral public key

pub initiator_ephemeral_key: Option<PublicKey>,
/// Responder's ephemeral public key

pub responder_ephemeral_key: Option<PublicKey>,
/// Shared session key (derived from ECDH)

pub session_key: Option<[u8; 32]>,
/// Number of packets sent

pub packets_sent: u64,
/// Number of packets received

pub packets_received: u64,
/// Number of bytes sent

pub bytes_sent: u64,
/// Number of bytes received

pub bytes_received: u64,
/// Number of retransmissions

pub retransmissions: u64,
/// Round-trip time estimate (milliseconds)

pub rtt_ms: Option<u64>
}

Source line: 47.

state::LinkState::new

pub fn new(link_id: LinkId) -> Self;

Source line: 90.

state::LinkState::set_status

pub fn set_status(&mut self, status: LinkStatus);

Source line: 110.

state::LinkState::activate

pub fn activate(&mut self);

Source line: 116.

state::LinkState::close

pub fn close(&mut self);

Source line: 122.

state::LinkState::fail

pub fn fail(&mut self);

Source line: 127.

state::LinkState::update_activity

pub fn update_activity(&mut self);

Source line: 132.

state::LinkState::is_active

pub fn is_active(&self) -> bool;

Source line: 137.

state::LinkState::is_established

pub fn is_established(&self) -> bool;

Source line: 142.

state::LinkState::is_terminated

pub fn is_terminated(&self) -> bool;

Source line: 147.

state::LinkState::is_stale

pub fn is_stale(&self, timeout: Duration) -> bool;

Source line: 152.

state::LinkState::age

pub fn age(&self) -> Duration;

Source line: 157.

state::LinkState::idle_time

pub fn idle_time(&self) -> Duration;

Source line: 162.

state::LinkState::record_sent

pub fn record_sent(&mut self, bytes: usize);

Source line: 167.

state::LinkState::record_received

pub fn record_received(&mut self, bytes: usize);

Source line: 174.

state::LinkState::record_retransmission

pub fn record_retransmission(&mut self);

Source line: 181.

state::LinkState::update_rtt

pub fn update_rtt(&mut self, rtt_ms: u64);

Source line: 186.

state::LinkState::throughput

pub fn throughput(&self) -> f64;

Source line: 196.

state::LinkState::packet_loss_rate

pub fn packet_loss_rate(&self) -> f64;

Source line: 206.

state::LinkConfig

#[derive(Debug, Clone)]
pub struct LinkConfig {
/// Maximum time to wait for link proof (seconds)

pub proof_timeout: Duration,
/// Keepalive interval (seconds)

pub keepalive_interval: Duration,
/// Stale timeout (seconds)

pub stale_timeout: Duration,
/// Maximum retransmission attempts

pub max_retransmit_attempts: u8,
/// Initial retransmission timeout (milliseconds)

pub retransmit_timeout: Duration,
/// Maximum packet size (bytes)

pub max_packet_size: usize
}

Source line: 218.

On this page