From 1980c7a69444af1508e69912e73871df0f88fa66 Mon Sep 17 00:00:00 2001 From: Appelmans Date: Fri, 17 Nov 2023 12:24:13 -0800 Subject: [PATCH] Added warning to initializer comment --- bindings/rust/s2n-tls/src/config.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bindings/rust/s2n-tls/src/config.rs b/bindings/rust/s2n-tls/src/config.rs index 1af9add413e..450ef5f8375 100644 --- a/bindings/rust/s2n-tls/src/config.rs +++ b/bindings/rust/s2n-tls/src/config.rs @@ -770,11 +770,15 @@ impl Default for Context { } } -/// A trait executed before a new connection negotiates TLS. +/// A trait executed asynchronously before a new connection negotiates TLS. +/// +/// Used for dynamic configuration of a specific connection. Note that this trait +/// +///
This trait is polled to completion inside of the +/// [connection::poll_negotiate function].(`crate::connection::poll_negotiate()`) +/// Therefore, negotiation of the TLS connection will not begin until the Future has completed. +///
/// -/// Used for any dynamic configuration of the connection. -/// Use in conjunction with -/// [config::Builder::set_connection_initializer](`crate::config::Builder::set_connection_initializer()`). pub trait ConnectionInitializer: 'static + Send + Sync { /// The application can return an `Ok(None)` to resolve the callback /// synchronously or return an `Ok(Some(ConnectionFuture))` if it wants to