Skip to content

Commit 5b5b49a

Browse files
RUST-2137 Support $lookup in CSFLE and QE (#51)
1 parent 10fe6fe commit 5b5b49a

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

mongocrypt/src/ctx.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ impl Ctx {
533533
}
534534

535535
/// Create a scope guard that provides handles to pending KMS requests.
536-
pub fn kms_scope(&mut self) -> KmsScope {
536+
pub fn kms_scope(&mut self) -> KmsScope<'_> {
537537
KmsScope { ctx: self }
538538
}
539539

@@ -651,7 +651,7 @@ impl<'ctx> KmsScope<'ctx> {
651651
///
652652
/// If KMS handles are being handled synchronously, the driver can reuse the same
653653
/// TLS socket to send HTTP requests and receive responses.
654-
pub fn next_kms_ctx(&self) -> Option<KmsCtx> {
654+
pub fn next_kms_ctx(&self) -> Option<KmsCtx<'_>> {
655655
let inner = unsafe { sys::mongocrypt_ctx_next_kms_ctx(*self.ctx.inner.borrow()) };
656656
if inner.is_null() {
657657
return None;

mongocrypt/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,15 @@ impl CryptBuilder {
236236
self
237237
}
238238

239+
/// Enable support for multiple collection schemas. Required to support $lookup.
240+
pub fn enable_multiple_collinfo(self) -> Result<Self> {
241+
let ok = unsafe { sys::mongocrypt_setopt_enable_multiple_collinfo(*self.inner.borrow()) };
242+
if !ok {
243+
return Err(self.status().as_error());
244+
}
245+
Ok(self)
246+
}
247+
239248
/// Opt-into skipping query analysis.
240249
///
241250
/// If opted in:

0 commit comments

Comments
 (0)