From 047f4d05f15b92de6eea9682f8295e47912fc4ba Mon Sep 17 00:00:00 2001 From: Isabel Atkinson Date: Thu, 6 Nov 2025 14:29:43 -0700 Subject: [PATCH] add method --- mongocrypt/src/ctx.rs | 4 ++-- mongocrypt/src/lib.rs | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/mongocrypt/src/ctx.rs b/mongocrypt/src/ctx.rs index e0074c6..95a1da7 100644 --- a/mongocrypt/src/ctx.rs +++ b/mongocrypt/src/ctx.rs @@ -533,7 +533,7 @@ impl Ctx { } /// Create a scope guard that provides handles to pending KMS requests. - pub fn kms_scope(&mut self) -> KmsScope { + pub fn kms_scope(&mut self) -> KmsScope<'_> { KmsScope { ctx: self } } @@ -651,7 +651,7 @@ impl<'ctx> KmsScope<'ctx> { /// /// If KMS handles are being handled synchronously, the driver can reuse the same /// TLS socket to send HTTP requests and receive responses. - pub fn next_kms_ctx(&self) -> Option { + pub fn next_kms_ctx(&self) -> Option> { let inner = unsafe { sys::mongocrypt_ctx_next_kms_ctx(*self.ctx.inner.borrow()) }; if inner.is_null() { return None; diff --git a/mongocrypt/src/lib.rs b/mongocrypt/src/lib.rs index c37feea..c84a75c 100644 --- a/mongocrypt/src/lib.rs +++ b/mongocrypt/src/lib.rs @@ -236,6 +236,15 @@ impl CryptBuilder { self } + /// Enable support for multiple collection schemas. Required to support $lookup. + pub fn enable_multiple_collinfo(self) -> Result { + let ok = unsafe { sys::mongocrypt_setopt_enable_multiple_collinfo(*self.inner.borrow()) }; + if !ok { + return Err(self.status().as_error()); + } + Ok(self) + } + /// Opt-into skipping query analysis. /// /// If opted in: