libuv/requests/
req_types.inc.rs

1#[allow(non_camel_case_types)]
2#[derive(Clone, Copy, Debug)]
3pub enum ReqType {
4    CONNECT,
5    FS,
6    GETADDRINFO,
7    GETNAMEINFO,
8    RANDOM,
9    REQ,
10    SHUTDOWN,
11    UDP_SEND,
12    WORK,
13    WRITE,
14    UNKNOWN,
15}
16
17impl crate::FromInner<uv::uv_req_type> for ReqType {
18    fn from_inner(t: uv::uv_req_type) -> ReqType {
19        match t {
20            uv::uv_req_type_UV_CONNECT => ReqType::CONNECT,
21            uv::uv_req_type_UV_FS => ReqType::FS,
22            uv::uv_req_type_UV_GETADDRINFO => ReqType::GETADDRINFO,
23            uv::uv_req_type_UV_GETNAMEINFO => ReqType::GETNAMEINFO,
24            uv::uv_req_type_UV_RANDOM => ReqType::RANDOM,
25            uv::uv_req_type_UV_REQ => ReqType::REQ,
26            uv::uv_req_type_UV_SHUTDOWN => ReqType::SHUTDOWN,
27            uv::uv_req_type_UV_UDP_SEND => ReqType::UDP_SEND,
28            uv::uv_req_type_UV_WORK => ReqType::WORK,
29            uv::uv_req_type_UV_WRITE => ReqType::WRITE,
30            _ => ReqType::UNKNOWN,
31        }
32    }
33}
34
35impl crate::IntoInner<uv::uv_req_type> for &ReqType {
36    fn into_inner(self) -> uv::uv_req_type {
37        match self {
38            ReqType::CONNECT => uv::uv_req_type_UV_CONNECT,
39            ReqType::FS => uv::uv_req_type_UV_FS,
40            ReqType::GETADDRINFO => uv::uv_req_type_UV_GETADDRINFO,
41            ReqType::GETNAMEINFO => uv::uv_req_type_UV_GETNAMEINFO,
42            ReqType::RANDOM => uv::uv_req_type_UV_RANDOM,
43            ReqType::REQ => uv::uv_req_type_UV_REQ,
44            ReqType::SHUTDOWN => uv::uv_req_type_UV_SHUTDOWN,
45            ReqType::UDP_SEND => uv::uv_req_type_UV_UDP_SEND,
46            ReqType::WORK => uv::uv_req_type_UV_WORK,
47            ReqType::WRITE => uv::uv_req_type_UV_WRITE,
48            _ => uv::uv_req_type_UV_UNKNOWN_REQ,
49        }
50    }
51}