sqlite_collections/db/
as_connection.rs1use rusqlite::{Connection, Savepoint, Transaction};
2
3pub trait AsConnection {
10 fn as_connection(&self) -> &Connection;
11}
12
13impl AsConnection for Connection {
14 fn as_connection(&self) -> &Connection {
15 self
16 }
17}
18
19impl AsConnection for &Connection {
20 fn as_connection(&self) -> &Connection {
21 *self
22 }
23}
24
25impl AsConnection for Transaction<'_> {
26 fn as_connection(&self) -> &Connection {
27 &*self
28 }
29}
30impl AsConnection for &Transaction<'_> {
31 fn as_connection(&self) -> &Connection {
32 &*self
33 }
34}
35
36impl AsConnection for Savepoint<'_> {
37 fn as_connection(&self) -> &Connection {
38 &*self
39 }
40}
41impl AsConnection for &Savepoint<'_> {
42 fn as_connection(&self) -> &Connection {
43 &*self
44 }
45}