Syntax for constraining an associated type in a generic trait impl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Connection; | |
trait ManageConnection { | |
type Connection; | |
type Error; | |
} | |
struct ConnectionManager; | |
struct Error; | |
/// Associated type `Connection` should be any type that implements the `Connection` trait. | |
impl<C> ManageConnection for ConnectionManager where ??? { | |
type Connection = C; | |
type Error = Error; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment