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§

source§

impl<Config: Config> Manager<Config>

source

pub fn new(initial_path: Path<Config>, peer_id_registry: PeerIdRegistry) -> Self

source

pub fn active_path(&self) -> &Path<Config>

Return the active path

source

pub fn active_path_mut(&mut self) -> &mut Path<Config>

Return a mutable reference to the active path

source

pub fn active_path_id(&self) -> Id

Return the Id of the active path

source

pub fn check_active_path_is_synced(&self)

source

pub fn path(&self, handle: &Config::PathHandle) -> Option<(Id, &Path<Config>)>

Returns the Path for the provided address if the PathManager knows about it

source

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

source

pub fn paths_pending_validation(&mut self) -> PathsPendingValidation<'_, Config>

Returns an iterator over all paths pending path_challenge or path_response transmission.

source

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, mtu_config: Config, limits: &Limits, publisher: &mut Pub ) -> Result<(Id, AmplificationOutcome), DatagramDropReason>

Called when a datagram is received on a connection Upon success, returns a (Id, AmplificationOutcome) containing the path ID and an AmplificationOutcome value that indicates 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.

source

pub fn valid_initial_received(&self) -> bool

Returns true if a valid initial packet has been received

source

pub fn on_transmit<W: WriteContext>(&mut self, context: &mut W)

Writes any frames the path manager wishes to transmit to the given context

source

pub fn on_packet_ack<A: Set>(&mut self, ack_set: &A)

Called when packets are acknowledged

source

pub fn on_packet_loss<A: Set>(&mut self, ack_set: &A)

Called when packets are lost

source

pub fn on_path_challenge(&mut self, path_id: Id, challenge: &PathChallenge<'_>)

source

pub fn on_path_response<Pub: ConnectionPublisher>( &mut self, response: &PathResponse<'_>, publisher: &mut Pub ) -> AmplificationOutcome

source

pub fn on_processed_packet<Pub: ConnectionPublisher>( &mut self, path_id: Id, source_connection_id: Option<PeerId>, path_validation_probing: Probe, random_generator: &mut dyn Generator, publisher: &mut Pub ) -> Result<AmplificationOutcome, 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.

Returns Ok(true) if the packet caused the active path to change from a path blocked by amplification limits to a path not blocked by amplification limits.

source

pub fn on_connection_id_retire(&self, _connection_id: &LocalId)

source

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

source

pub fn on_timeout<Pub: ConnectionPublisher>( &mut self, timestamp: Timestamp, random_generator: &mut dyn Generator, publisher: &mut Pub ) -> Result<AmplificationOutcome, Error>

Called when the connection timer expired

Returns Ok(true) if the timeout caused the active path to change from a path blocked by amplification limits to a path not blocked by amplification limits. This can occur if the active path was amplification limited and failed path validation.

source

pub fn is_amplification_limited(&self) -> bool

true if ALL paths are amplification_limited

source

pub fn can_transmit(&self, interest: Interest) -> bool

true if ANY of the paths can transmit

source

pub fn transmission_constraint(&self) -> Constraint

source

pub fn max_mtu(&self) -> MaxMtu

Returns the maximum size the UDP payload can reach for any probe packet.

Trait Implementations§

source§

impl<Config: Debug + Config> Debug for Manager<Config>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Config: Config> Index<Id> for Manager<Config>

§

type Output = Path<Config>

The returned type after indexing.
source§

fn index(&self, id: Id) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<Config: Config> IndexMut<Id> for Manager<Config>

source§

fn index_mut(&mut self, id: Id) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<Config: Config> Provider for Manager<Config>

source§

impl<Config: Config> Provider for Manager<Config>

source§

fn timers<Q: Query>(&self, query: &mut Q) -> Result

Notifies the query of any timers owned by the provider Read more
source§

fn next_expiration(&self) -> Option<Timestamp>

Returns the next Timestamp at which the earliest timer is armed in the provider
source§

fn is_armed(&self) -> bool

Returns true if there are any timers armed
source§

fn armed_timer_count(&self) -> usize

Counts the number of armed timers in the provider
source§

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> !Freeze for Manager<Config>

§

impl<Config> !RefUnwindSafe for Manager<Config>

§

impl<Config> Send for Manager<Config>

§

impl<Config> !Sync for Manager<Config>

§

impl<Config> Unpin for Manager<Config>

§

impl<Config> UnwindSafe for Manager<Config>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, U> Upcast<T> for U
where T: UpcastFrom<U>,

source§

fn upcast(self) -> T

source§

impl<T, B> UpcastFrom<Counter<T, B>> for T

source§

fn upcast_from(value: Counter<T, B>) -> T