Skip to content

Commit

Permalink
config/doc: module documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
BiagioFesta committed Oct 8, 2023
1 parent 668e928 commit 8ca6e20
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions wtransport/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
//! This module defines configurations for the WebTransport server and client.
//! It provides builders for creating server and client configurations with various options.
//!
//! The module includes:
//! - [`ServerConfig`]: Configuration for the WebTransport server.
//! - [`ClientConfig`]: Configuration for the WebTransport client.
//!
//! Example for creating a server configuration:
//!
//! ```no_run
//! use wtransport::tls::Certificate;
//! use wtransport::ServerConfig;
//!
//! let server_config = ServerConfig::builder()
//! .with_bind_default(443)
//! .with_certificate(Certificate::load("cert.pem", "key.pem").unwrap())
//! .build();
//! ```
//!
//! Example for creating a client configuration:
//!
//! ```no_run
//! use wtransport::ClientConfig;
//!
//! let client_config = ClientConfig::builder()
//! .with_bind_default()
//! .with_native_certs()
//! .build();
//! ```

use crate::tls::Certificate;
use quinn::ClientConfig as QuicClientConfig;
use quinn::ServerConfig as QuicServerConfig;
Expand Down

0 comments on commit 8ca6e20

Please sign in to comment.