pub trait ConnectionIdGenerator<'a>:
Send
+ Sync
+ 'static {
// Required methods
fn new_connection_id(&self) -> ConnectionId<'a>;
fn verify_connection_id(&self, cid: &ConnectionId<'_>) -> QuicResult<()>;
}Expand description
A customizable generator to derive and verify QUIC connection IDs.
For QUIC servers, it can be useful to encode additional information in the
source connection ID. This trait allows users to implement their own logic
for that purpose. The crate also provides SimpleConnectionIdGenerator
if no such customization is needed.
Clients currently can’t configure a ConnectionIdGenerator and always use
the SimpleConnectionIdGenerator.
Required Methods§
Sourcefn new_connection_id(&self) -> ConnectionId<'a>
fn new_connection_id(&self) -> ConnectionId<'a>
Creates a new ConnectionId according to the generator’s logic.
Sourcefn verify_connection_id(&self, cid: &ConnectionId<'_>) -> QuicResult<()>
fn verify_connection_id(&self, cid: &ConnectionId<'_>) -> QuicResult<()>
Verifies whether cid was generated by this ConnectionIdGenerator.