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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
use maidsafe_utilities::serialisation::SerialisationError;
use safe_crypto;
use std::io;
#[derive(Debug)]
pub struct UdtError {
pub err_msg: String,
}
quick_error! {
#[derive(Debug)]
pub enum SocketError {
Io(e: io::Error) {
description(e.description())
display("Io error: {}", e)
cause(e)
from()
}
UninitialisedSocket {
description("Socket is uninitialised and invalid for any operation")
display("Socket is uninitialised and invalid for any operation")
}
PayloadSizeProhibitive {
description("Payload is too large")
}
Serialisation(e: SerialisationError) {
description(e.description())
display("Serialisation error: {}", e)
cause(e)
from()
}
ZeroByteRead {
description("Read zero bytes from the socket - indicates EOF")
}
Udt(e: UdtError) {
description(&e.err_msg)
display("Udt error: {}", e.err_msg)
from()
}
UnconnectedUdpSocket {
description("UDP Socket is not connected")
}
NoUdtEpoll {
description("No UDT Epoll while registering/deregistering")
}
UdtNegativeBytesRead(val: i32) {
description("UDT Read has resulted in a negative result. This is an error value.")
display("UDT Read has resulted in a negative result. This is an error value: {}", val)
}
UdtNegativeBytesWrite(val: i32) {
description("UDT Write has resulted in a negative result. This is an error value.")
display("UDT Write has resulted in a negative result. This is an error value: {}", val)
}
Crypto(e: safe_crypto::Error) {
display("Crypto related error: {}", e)
from()
}
}
}