pub(crate) trait HalfStreamFlowCtrlHooks {
// Required methods
fn handle_incoming_dropped(&mut self, msg_count: u16) -> Result<()>;
fn handle_incoming_msg(
&mut self,
msg: UnparsedRelayMsg,
) -> Result<Option<UnparsedRelayMsg>>;
}Expand description
Methods that can be called on a HalfStreamFlowCtrl.
We use a trait so that we can use enum_dispatch on the inner HalfStreamFlowCtrlInner enum.
While this may seem unnecessary since this trait currently only has two methods,
it’s consistent with the FlowCtrlHooks trait above.
Required Methods§
Sourcefn handle_incoming_dropped(&mut self, msg_count: u16) -> Result<()>
fn handle_incoming_dropped(&mut self, msg_count: u16) -> Result<()>
Handle some number of dropped stream messages.
We don’t know what kinds of stream messages were dropped, only the number of them.
This method exists because currently the stream entry may drop some incoming stream messages and they would never be processed by this flow control object otherwise.
Sourcefn handle_incoming_msg(
&mut self,
msg: UnparsedRelayMsg,
) -> Result<Option<UnparsedRelayMsg>>
fn handle_incoming_msg( &mut self, msg: UnparsedRelayMsg, ) -> Result<Option<UnparsedRelayMsg>>
Handle an incoming message.
If it’s a flow control message, it will be consumed and None will be returned.
Otherwise the original message will be returned.
Takes the UnparsedRelayMsg so that we don’t even try to decode it if we’re not using the
correct type of flow control.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".