Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. fn connections(address: SocketAddr, config Config) -> Box<impl Stream<Item = impl Sink, Error = Error> {
  2. let listener = TcpListener::bind(&address).unwrap();
  3.  
  4. Box::new(listener.incoming().map(move |socket| {
  5. Framed::new(
  6. socket,
  7. IrcCodec::new(config.encoding()).expect("Can't connect")
  8. )
  9. }))
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement