Skip to content

refactor(s2n-quic-dc): use map getter method to replace AsRef for Handshake trait - #2746

Merged
boquan-fang merged 1 commit into
aws:mainfrom
boquan-fang:handshake-trait-change
Aug 7, 2025
Merged

refactor(s2n-quic-dc): use map getter method to replace AsRef for Handshake trait#2746
boquan-fang merged 1 commit into
aws:mainfrom
boquan-fang:handshake-trait-change

Conversation

@boquan-fang

Copy link
Copy Markdown
Contributor

Release Summary:

Resolved issues:

related to #2741, and #2744.

Description of changes:

After some review, I decided to not use a AsRef trait to retrieve the secret::Map that's associated with the client and server tokio builders:

pub trait Handshake: AsRef<secret::Map> + Clone {
fn local_addr(&self) -> SocketAddr;
}

pub trait Handshake: AsRef<secret::Map> + Clone {
/// Handshake with the remote peer
async fn handshake_with_entry(
&self,
remote_handshake_addr: SocketAddr,
) -> std::io::Result<(secret::map::Peer, secret::HandshakeKind)>;
fn local_addr(&self) -> std::io::Result<SocketAddr>;
}

Instead, we can just add a map method to extract the secrete::Map. Using the AsRef trait is hard to remove in the future and this Handshake trait is just a temporary solution to the fact that some methods hasn't been implemented.

Call-outs:

Testing:

I did internal integration test for this.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@boquan-fang
boquan-fang marked this pull request as ready for review August 6, 2025 22:11
@boquan-fang boquan-fang changed the title refactor(s2n-quic-dc): use map method to replace AsRef for Handshake trait refactor(s2n-quic-dc): use map getter method to replace AsRef for Handshake trait Aug 6, 2025
@boquan-fang
boquan-fang merged commit 9fe81de into aws:main Aug 7, 2025
120 checks passed
@boquan-fang
boquan-fang deleted the handshake-trait-change branch August 7, 2025 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants