title: Working with UDP using mio and getting an error "MutBuf is not implemented for the type MutSliceBuf"
body: <p>For learning purposes I am currently trying to write small program which will implement echo-server for UDP packets which will work on a certain set of ports (say 10000-60000). So as it wouldn't be so good to spam 50k threads for this I need to use asynchronous IO and mio is excellent match for this task. But I've got a problem right from the start with this code:</p>
  
  <pre><code>extern crate mio;
  extern crate bytes;
  use mio::udp::*;
  use bytes::MutSliceBuf;
  
  fn main() {
      let addr = "127.0.0.1:10000".parse().unwrap();
  
      let socket = UdpSocket::bound(&amp;addr).unwrap();
  
      let mut buf = [0; 128];
      socket.recv_from(&amp;mut MutSliceBuf::wrap(&amp;mut buf));
  }
  </code></pre>
  
  <p>It is almost full copypaste from of mio's test_udp_socket.rs.But while mio's tests successfully pass through, then I try to compile this code I am getting following error:</p>
  
  <pre><code>src/main.rs:12:12: 12:55 error: the trait `bytes::buf::MutBuf` is not implemented for the type `bytes::buf::slice::MutSliceBuf&lt;'_&gt;` [E0277]
  src/main.rs:12     socket.recv_from(&amp;mut MutSliceBuf::wrap(&amp;mut buf));
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/main.rs:12:12: 12:55 help: run `rustc --explain E0277` to see a detailed explanation
  </code></pre>
  
  <p>But examining code of src/buf/slice.rs from bytes crate (local copy of it too) we can clearly see what this trait was implemented:</p>
  
  <pre><code>impl&lt;'a&gt; MutBuf for MutSliceBuf&lt;'a&gt; {
      fn remaining(&amp;self) -&gt; usize {
          self.bytes.len() - self.pos
      }
  
      fn advance(&amp;mut self, mut cnt: usize) {
          cnt = cmp::min(cnt, self.remaining());
          self.pos += cnt;
      }
  
      unsafe fn mut_bytes&lt;'b&gt;(&amp;'b mut self) -&gt; &amp;'b mut [u8] {
          &amp;mut self.bytes[self.pos..]
      }
  }
  </code></pre>
  
  <p>It's probably something trivial, but I can't find it... What could be a problem which causes this error?</p>
  
  <p>I am using rustc 1.3.0 (9a92aaf19 2015-09-15), crates mio and bytes is gotten straight from github.</p>