[−][src]Macro slimweb::implbufread
Generic impl BufRead macro.
Example:
ⓘThis example is not tested
implbufread!(Stream, (Http, #[cfg(feature = "tls")] Https));
Becomes:
ⓘThis example is not tested
impl BufRead for Stream { fn fill_buf(&mut self) -> IoResult<&[u8]> { match self { Stream::Http(s) => s.fill_buf(), #[cfg(feature = "tls")] Stream::Https(s) => s.fill_buf(), } } fn consume(&mut self, amt: usize) { match self { Stream::Http(s) => s.consume(amt), #[cfg(feature = "tls")] Stream::Https(s) => s.consume(amt), } } }