1
mod udpsocket;
2
mod bucket;
3
mod socketaddr;
4

            
5
pub use socketaddr::SocketAddr;
6
pub use udpsocket::{ UdpSocket,
7
		     RecvInfo as UdpRecvInfo };
8
pub use bucket::Bucket;
9

            
10
pub trait ToLower {
11
    type Char;
12
    fn to_lower(self) -> Vec<Self::Char>;
13
}
14

            
15
impl ToLower for &[u8] {
16
    type Char = u8;
17

            
18
    fn to_lower(self) -> Vec<u8>
19
    {
20
	let mut res = Vec::<u8>::with_capacity(self.len());
21

            
22
	for c in self {
23
	    res.push(match c {
24
		b'A'..=b'Z'	=> *c + 32,
25
		_		=> *c,
26
	    });
27
	}
28

            
29
	res
30
    }
31
}