Skip to main content

AbstractConfluxMsgHandler

Trait AbstractConfluxMsgHandler 

Source
pub(crate) trait AbstractConfluxMsgHandler {
    // Required methods
    fn validate_source_hop(
        &self,
        msg: &UnparsedRelayMsg,
        hop: HopNum,
    ) -> Result<()>;
    fn handle_msg(
        &mut self,
        msg: UnparsedRelayMsg,
        hop: HopNum,
    ) -> Result<Option<ConfluxCmd>>;
    fn status(&self) -> ConfluxStatus;
    fn note_link_sent(&mut self, ts: SystemTime) -> Result<(), Bug>;
    fn handshake_timeout(&self) -> Option<SystemTime>;
    fn init_rtt(&self) -> Option<Duration>;
    fn last_seq_recv(&self) -> u64;
    fn last_seq_sent(&self) -> u64;
    fn set_last_seq_sent(&mut self, n: u64);
    fn inc_last_seq_recv(&mut self);
    fn inc_last_seq_sent(&mut self);
}
Expand description

An object that can process conflux relay messages and manage the conflux state of a circuit.

This is indirectly used by the circuit reactor (via ConfluxSet) for conflux handling.

Required Methods§

Source

fn validate_source_hop(&self, msg: &UnparsedRelayMsg, hop: HopNum) -> Result<()>

Validate the specified source hop of a conflux cell.

Source

fn handle_msg( &mut self, msg: UnparsedRelayMsg, hop: HopNum, ) -> Result<Option<ConfluxCmd>>

Handle the specified conflux msg.

Source

fn status(&self) -> ConfluxStatus

Returns the conflux status of this handler.

Client-only: note that the LINK cell was sent.

Source

fn handshake_timeout(&self) -> Option<SystemTime>

Get the wallclock time when the handshake on this circuit is supposed to time out.

Returns None if the handshake is not currently in progress.

Source

fn init_rtt(&self) -> Option<Duration>

Returns the initial RTT measured by this handler.

Source

fn last_seq_recv(&self) -> u64

Return the sequence number of the last message received on this leg.

Source

fn last_seq_sent(&self) -> u64

Return the sequence number of the last message sent on this leg.

Source

fn set_last_seq_sent(&mut self, n: u64)

Set the sequence number of the last message sent on this leg.

Source

fn inc_last_seq_recv(&mut self)

Increment the sequence number of the last message received on this leg.

Source

fn inc_last_seq_sent(&mut self)

Increment the sequence number of the last message sent on this leg.

Implementors§