-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a generic Carrier type, lifting event handler states into a…
…n event context. The code right now is super nasty, since it is not currently possible to implement TelnetChannel for all T where Carrier<T> implements ChannelHandler. This is an explicit feature of the `where` clause, and a Rust issue is open for this. (rust-lang/rust#20414)
- Loading branch information
Showing
3 changed files
with
42 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pub struct Carrier<'parent, 'state, Parent: 'parent, State: 'state> { | ||
pub parent: &'parent mut Parent, | ||
pub state: &'state mut State, | ||
} |
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
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