Skip to content

Commit 86c914c

Browse files
authored
Merge pull request sfackler#853 from elpiel/boxed-dyn-ToSql
Boxed owned query parameters
2 parents 774016d + c516805 commit 86c914c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

postgres-types/src/lib.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,23 @@ impl BorrowToSql for &dyn ToSql {
10831083
}
10841084
}
10851085

1086+
impl sealed::Sealed for Box<dyn ToSql + Sync> {}
1087+
1088+
impl BorrowToSql for Box<dyn ToSql + Sync> {
1089+
#[inline]
1090+
fn borrow_to_sql(&self) -> &dyn ToSql {
1091+
self.as_ref()
1092+
}
1093+
}
1094+
1095+
impl sealed::Sealed for Box<dyn ToSql + Sync + Send> {}
1096+
impl BorrowToSql for Box<dyn ToSql + Sync + Send> {
1097+
#[inline]
1098+
fn borrow_to_sql(&self) -> &dyn ToSql {
1099+
self.as_ref()
1100+
}
1101+
}
1102+
10861103
impl sealed::Sealed for &(dyn ToSql + Sync) {}
10871104

10881105
/// In async contexts it is sometimes necessary to have the additional

0 commit comments

Comments
 (0)