Skip to content

Commit

Permalink
Expose the inner QUIC connection
Browse files Browse the repository at this point in the history
  • Loading branch information
MOZGIII authored and BiagioFesta committed Sep 15, 2024
1 parent 194b583 commit 31d83d5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions wtransport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ rustdoc-args = ["--cfg", "docsrs"]
allowed_external_types = [
"bytes::bytes::Bytes",
"quinn",
"quinn::connection::Connection",
"quinn::recv_stream::ReadError",
"quinn::recv_stream::RecvStream",
"quinn::send_stream::SendStream",
Expand Down
16 changes: 16 additions & 0 deletions wtransport/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,4 +404,20 @@ impl Connection {
server_name: hd.server_name,
}
}

/// Returns a reference to the inner QUIC connection.
#[cfg(feature = "quinn")]
#[cfg_attr(docsrs, doc(cfg(feature = "quinn")))]
#[inline(always)]
pub fn quic_connection(&self) -> &quinn::Connection {
&self.quic_connection
}

/// Returns a mutable reference to the inner QUIC connection.
#[cfg(feature = "quinn")]
#[cfg_attr(docsrs, doc(cfg(feature = "quinn")))]
#[inline(always)]
pub fn quic_connection_mut(&mut self) -> &mut quinn::Connection {
&mut self.quic_connection
}
}

0 comments on commit 31d83d5

Please sign in to comment.