You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This'd probably require some new syntax to limit F to Foos with lifetime parameters. Potentially related to #5922.
Use Case
In https://github.com/sfackler/rust-postgres, the PostgresConnection and PostgresTransaction types can both prepare statements. However, PostgresConnection.prepare and PostgresTransaction.prepare return different implementations of the PostgresStatement trait. Both implementations of PostgresStatement contain borrowed pointers to their parent PostgresConnection and the lifetime of a statement is semantically tied to a connection in any case. I'd like to have a trait to unify this functionality. It'd look something like
TL;DR
It'd be nice if something like this were possible:
This'd probably require some new syntax to limit
F
toFoo
s with lifetime parameters. Potentially related to #5922.Use Case
In https://github.com/sfackler/rust-postgres, the
PostgresConnection
andPostgresTransaction
types can both prepare statements. However,PostgresConnection.prepare
andPostgresTransaction.prepare
return different implementations of thePostgresStatement
trait. Both implementations ofPostgresStatement
contain borrowed pointers to their parentPostgresConnection
and the lifetime of a statement is semantically tied to a connection in any case. I'd like to have a trait to unify this functionality. It'd look something likeThe text was updated successfully, but these errors were encountered: