1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use bytes::BytesMut;
use std::io;
use tokio_codec::{Decoder, Encoder};
use super::proto::dns_wire::WireResponse;
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct DNSResponseCodec {}
impl DNSResponseCodec {
pub fn new() -> DNSResponseCodec {
DNSResponseCodec {}
}
}
impl Decoder for DNSResponseCodec {
type Item = WireResponse;
type Error = io::Error;
fn decode(&mut self, _buf: &mut BytesMut) -> Result<Option<WireResponse>, io::Error> {
Ok(None)
}
}
impl Encoder for DNSResponseCodec {
type Item = WireResponse;
type Error = io::Error;
fn encode(&mut self, _response: WireResponse, _buf: &mut BytesMut) -> Result<(), io::Error> {
Ok(())
}
}