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§
Sourcefn validate_source_hop(&self, msg: &UnparsedRelayMsg, hop: HopNum) -> Result<()>
fn validate_source_hop(&self, msg: &UnparsedRelayMsg, hop: HopNum) -> Result<()>
Validate the specified source hop of a conflux cell.
Sourcefn handle_msg(
&mut self,
msg: UnparsedRelayMsg,
hop: HopNum,
) -> Result<Option<ConfluxCmd>>
fn handle_msg( &mut self, msg: UnparsedRelayMsg, hop: HopNum, ) -> Result<Option<ConfluxCmd>>
Handle the specified conflux msg.
Sourcefn status(&self) -> ConfluxStatus
fn status(&self) -> ConfluxStatus
Returns the conflux status of this handler.
Sourcefn note_link_sent(&mut self, ts: SystemTime) -> Result<(), Bug>
fn note_link_sent(&mut self, ts: SystemTime) -> Result<(), Bug>
Client-only: note that the LINK cell was sent.
Sourcefn handshake_timeout(&self) -> Option<SystemTime>
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.
Sourcefn last_seq_recv(&self) -> u64
fn last_seq_recv(&self) -> u64
Return the sequence number of the last message received on this leg.
Sourcefn last_seq_sent(&self) -> u64
fn last_seq_sent(&self) -> u64
Return the sequence number of the last message sent on this leg.
Sourcefn set_last_seq_sent(&mut self, n: u64)
fn set_last_seq_sent(&mut self, n: u64)
Set the sequence number of the last message sent on this leg.
Sourcefn inc_last_seq_recv(&mut self)
fn inc_last_seq_recv(&mut self)
Increment the sequence number of the last message received on this leg.
Sourcefn inc_last_seq_sent(&mut self)
fn inc_last_seq_sent(&mut self)
Increment the sequence number of the last message sent on this leg.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".