Skip to content

Commit 95edf39

Browse files
committed
Add missing docs
1 parent 987fb75 commit 95edf39

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

src/lib.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,10 @@
7171
//!
7272
//! # History
7373
//!
74-
//! This crate evolved out of the [quic-rpc] crate, which is a generic RPC
74+
//! This crate evolved out of the [quic-rpc](https://docs.rs/quic-rpc/latest/quic-rpc/index.html) crate, which is a generic RPC
7575
//! framework for any transport with cheap streams such as QUIC. Compared to
7676
//! quic-rpc, this crate does not abstract over the stream type and is focused
77-
//! on [iroh](https://docs.rs/iroh/latest/iroh/index.html) and our [iroh quinn fork].
78-
//!
79-
//! - [quic-rpc](https://docs.rs/quic-rpc/latest/quic-rpc/index.html)
80-
//! - [quinn](https://docs.rs/quinn/latest/quinn/index.html)
81-
//! - [bytes](https://docs.rs/bytes/latest/bytes/index.html)
82-
//! - [iroh quinn fork](https://docs.rs/iroh-quinn/latest/iroh-quinn/index.html)
77+
//! on [iroh](https://docs.rs/iroh/latest/iroh/index.html) and our [iroh quinn fork](https://docs.rs/iroh-quinn/latest/iroh-quinn/index.html).
8378
#![cfg_attr(quicrpc_docsrs, feature(doc_cfg))]
8479
use std::{fmt::Debug, future::Future, io, marker::PhantomData, ops::Deref};
8580

src/util.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mod quinn_setup_utils {
1010
use anyhow::Result;
1111
use quinn::{crypto::rustls::QuicClientConfig, ClientConfig, ServerConfig};
1212

13-
/// Builds default quinn client config and trusts given certificates.
13+
/// Create a quinn client config and trusts given certificates.
1414
///
1515
/// ## Args
1616
///
@@ -52,6 +52,7 @@ mod quinn_setup_utils {
5252
Ok((server_config, cert_der.to_vec()))
5353
}
5454

55+
/// Create a quinn client config and trust all certificates.
5556
pub fn configure_client_insecure() -> Result<ClientConfig> {
5657
let crypto = rustls::ClientConfig::builder()
5758
.dangerous()
@@ -85,16 +86,7 @@ mod quinn_setup_utils {
8586
Ok(endpoint)
8687
}
8788

88-
/// Create a server endpoint with a self-signed certificate
89-
///
90-
/// Returns the server endpoint and the certificate in DER format
91-
pub fn make_server_endpoint(bind_addr: SocketAddr) -> Result<(Endpoint, Vec<u8>)> {
92-
let (server_config, server_cert) = configure_server()?;
93-
let endpoint = Endpoint::server(server_config, bind_addr)?;
94-
Ok((endpoint, server_cert))
95-
}
96-
97-
/// Constructs a QUIC endpoint that trusts all certificates.
89+
/// Constructs a QUIC endpoint configured for use a client only that trusts all certificates.
9890
///
9991
/// This is useful for testing and local connections, but should be used with care.
10092
pub fn make_insecure_client_endpoint(bind_addr: SocketAddr) -> Result<Endpoint> {
@@ -103,6 +95,15 @@ mod quinn_setup_utils {
10395
endpoint.set_default_client_config(client_cfg);
10496
Ok(endpoint)
10597
}
98+
99+
/// Constructs a QUIC server endpoint with a self-signed certificate
100+
///
101+
/// Returns the server endpoint and the certificate in DER format
102+
pub fn make_server_endpoint(bind_addr: SocketAddr) -> Result<(Endpoint, Vec<u8>)> {
103+
let (server_config, server_cert) = configure_server()?;
104+
let endpoint = Endpoint::server(server_config, bind_addr)?;
105+
Ok((endpoint, server_cert))
106+
}
106107
}
107108

108109
#[cfg(not(target_arch = "wasm32"))]

0 commit comments

Comments
 (0)