Skip to content

Commit

Permalink
config: methods for inner QUIC configuration access
Browse files Browse the repository at this point in the history
  • Loading branch information
BiagioFesta committed Oct 5, 2023
1 parent 73dd90d commit 57d2fc8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions wtransport/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,20 @@ impl ServerConfig {
pub fn builder() -> ServerConfigBuilder<WantsBindAddress> {
ServerConfigBuilder::default()
}

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

/// Returns a mutable reference to the inner QUIC configuration.
#[cfg(feature = "quinn")]
#[cfg_attr(docsrs, doc(cfg(feature = "quinn")))]
pub fn quic_config_mut(&mut self) -> &mut quinn::ServerConfig {
&mut self.quic_config
}
}

/// Server builder configuration.
Expand Down Expand Up @@ -269,6 +283,20 @@ impl ClientConfig {
pub fn builder() -> ClientConfigBuilder<WantsBindAddress> {
ClientConfigBuilder::default()
}

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

/// Returns a mutable reference to the inner QUIC configuration.
#[cfg(feature = "quinn")]
#[cfg_attr(docsrs, doc(cfg(feature = "quinn")))]
pub fn quic_config_mut(&mut self) -> &mut quinn::ClientConfig {
&mut self.quic_config
}
}

impl Default for ClientConfig {
Expand Down

0 comments on commit 57d2fc8

Please sign in to comment.