Struct s2n_quic_transport::path::Manager
source · [−]pub struct Manager<Config: Config> { /* private fields */ }
Expand description
The PathManager handles paths for a specific connection. It will handle path validation operations, and track the active path for a connection.
Implementations
sourceimpl<Config: Config> Manager<Config>
impl<Config: Config> Manager<Config>
pub fn new(initial_path: Path<Config>, peer_id_registry: PeerIdRegistry) -> Self
sourcepub fn active_path(&self) -> &Path<Config>
pub fn active_path(&self) -> &Path<Config>
Return the active path
sourcepub fn active_path_mut(&mut self) -> &mut Path<Config>
pub fn active_path_mut(&mut self) -> &mut Path<Config>
Return a mutable reference to the active path
sourcepub fn active_path_id(&self) -> Id
pub fn active_path_id(&self) -> Id
Return the Id of the active path
pub fn check_active_path_is_synced(&self)
pub fn activate_path<Pub: ConnectionPublisher>(
&mut self,
publisher: &mut Pub,
prev_path_id: Id,
new_path_id: Id
)
sourcepub fn path(&self, handle: &Config::PathHandle) -> Option<(Id, &Path<Config>)>
pub fn path(&self, handle: &Config::PathHandle) -> Option<(Id, &Path<Config>)>
Returns the Path for the provided address if the PathManager knows about it
sourcepub fn path_mut(
&mut self,
handle: &Config::PathHandle
) -> Option<(Id, &mut Path<Config>)>
pub fn path_mut(
&mut self,
handle: &Config::PathHandle
) -> Option<(Id, &mut Path<Config>)>
Returns the Path for the provided address if the PathManager knows about it
sourcepub fn paths_pending_validation(&mut self) -> PathsPendingValidation<'_, Config>
pub fn paths_pending_validation(&mut self) -> PathsPendingValidation<'_, Config>
Returns an iterator over all paths pending path_challenge or path_response transmission.
sourcepub fn on_datagram_received<Pub: ConnectionPublisher>(
&mut self,
path_handle: &Config::PathHandle,
datagram: &DatagramInfo,
handshake_confirmed: bool,
congestion_controller_endpoint: &mut Config::CongestionControllerEndpoint,
migration_validator: &mut Config::PathMigrationValidator,
max_mtu: MaxMtu,
publisher: &mut Pub
) -> Result<(Id, bool), DatagramDropReason>
pub fn on_datagram_received<Pub: ConnectionPublisher>(
&mut self,
path_handle: &Config::PathHandle,
datagram: &DatagramInfo,
handshake_confirmed: bool,
congestion_controller_endpoint: &mut Config::CongestionControllerEndpoint,
migration_validator: &mut Config::PathMigrationValidator,
max_mtu: MaxMtu,
publisher: &mut Pub
) -> Result<(Id, bool), DatagramDropReason>
Called when a datagram is received on a connection
Upon success, returns a (Id, bool)
containing the path ID and a boolean that is
true if the path had been amplification limited prior to receiving the datagram
and is now no longer amplification limited.
This function is called prior to packet authentication. If possible add business
logic to Self::on_processed_packet
, which is called after the packet has been
authenticated.
sourcepub fn valid_initial_received(&self) -> bool
pub fn valid_initial_received(&self) -> bool
Returns true if a valid initial packet has been received
sourcepub fn on_transmit<W: WriteContext>(&mut self, context: &mut W)
pub fn on_transmit<W: WriteContext>(&mut self, context: &mut W)
Writes any frames the path manager wishes to transmit to the given context
sourcepub fn on_packet_ack<A: Set>(&mut self, ack_set: &A)
pub fn on_packet_ack<A: Set>(&mut self, ack_set: &A)
Called when packets are acknowledged
sourcepub fn on_packet_loss<A: Set>(&mut self, ack_set: &A)
pub fn on_packet_loss<A: Set>(&mut self, ack_set: &A)
Called when packets are lost
pub fn on_path_challenge(&mut self, path_id: Id, challenge: &PathChallenge<'_>)
pub fn on_path_response<Pub: ConnectionPublisher>(
&mut self,
response: &PathResponse<'_>,
publisher: &mut Pub
)
sourcepub fn on_processed_packet<Pub: ConnectionPublisher>(
&mut self,
path_id: Id,
source_connection_id: Option<PeerId>,
path_validation_probing: Probe,
random_generator: &mut Config::RandomGenerator,
publisher: &mut Pub
) -> Result<(), Error>
pub fn on_processed_packet<Pub: ConnectionPublisher>(
&mut self,
path_id: Id,
source_connection_id: Option<PeerId>,
path_validation_probing: Probe,
random_generator: &mut Config::RandomGenerator,
publisher: &mut Pub
) -> Result<(), Error>
Process a packet and update internal state.
Check if the packet is a non-probing (path validation) packet and attempt to update the active path for the connection.
pub fn on_connection_id_retire(&self, _connection_id: &LocalId)
sourcepub fn on_new_connection_id<Pub: ConnectionPublisher>(
&mut self,
connection_id: &PeerId,
sequence_number: u32,
retire_prior_to: u32,
stateless_reset_token: &Token,
publisher: &mut Pub
) -> Result<(), Error>
pub fn on_new_connection_id<Pub: ConnectionPublisher>(
&mut self,
connection_id: &PeerId,
sequence_number: u32,
retire_prior_to: u32,
stateless_reset_token: &Token,
publisher: &mut Pub
) -> Result<(), Error>
Called when a NEW_CONNECTION_ID frame is received from the peer
pub fn on_timeout<Pub: ConnectionPublisher>(
&mut self,
timestamp: Timestamp,
random_generator: &mut Config::RandomGenerator,
publisher: &mut Pub
) -> Result<(), Error>
sourcepub fn on_closing(&mut self)
pub fn on_closing(&mut self)
Notifies the path manager of the connection closing event
sourcepub fn is_amplification_limited(&self) -> bool
pub fn is_amplification_limited(&self) -> bool
true if ALL paths are amplification_limited
sourcepub fn can_transmit(&self, interest: Interest) -> bool
pub fn can_transmit(&self, interest: Interest) -> bool
true if ANY of the paths can transmit
pub fn transmission_constraint(&self) -> Constraint
Trait Implementations
sourceimpl<Config: Config> Provider for Manager<Config>
impl<Config: Config> Provider for Manager<Config>
sourcefn timers<Q: Query>(&self, query: &mut Q) -> Result
fn timers<Q: Query>(&self, query: &mut Q) -> Result
Notifies the query of any timers owned by the provider Read more
sourcefn next_expiration(&self) -> Option<Timestamp>
fn next_expiration(&self) -> Option<Timestamp>
Returns the next Timestamp
at which the earliest timer is armed in the provider
sourcefn armed_timer_count(&self) -> usize
fn armed_timer_count(&self) -> usize
Counts the number of armed timers in the provider
sourcefn for_each_timer<F>(&self, f: F) where
F: FnMut(&Timer) -> Result<(), QueryBreak>,
fn for_each_timer<F>(&self, f: F) where
F: FnMut(&Timer) -> Result<(), QueryBreak>,
Iterates over each timer in the provider and calls the provided function
Auto Trait Implementations
impl<Config> RefUnwindSafe for Manager<Config> where
<<Config as Config>::CongestionControllerEndpoint as Endpoint>::CongestionController: RefUnwindSafe,
<Config as Config>::PathHandle: RefUnwindSafe,
impl<Config> Send for Manager<Config>
impl<Config> Sync for Manager<Config> where
<<Config as Config>::CongestionControllerEndpoint as Endpoint>::CongestionController: Sync,
<Config as Config>::PathHandle: Sync,
impl<Config> Unpin for Manager<Config> where
<<Config as Config>::CongestionControllerEndpoint as Endpoint>::CongestionController: Unpin,
<Config as Config>::PathHandle: Unpin,
impl<Config> UnwindSafe for Manager<Config> where
<<Config as Config>::CongestionControllerEndpoint as Endpoint>::CongestionController: UnwindSafe + RefUnwindSafe,
<Config as Config>::PathHandle: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more