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
use async_trait;
use MessageError;
use Packet;
use ;
use Debug;
use io;
use Pin;
/// Generalization of the underlying CoAP transport, intended primarily to make it easy to support a
/// wide range of protocols (TCP, DTLS, websockets, BLE, etc) but also to eventually support
/// alternative runtime frameworks such as Embassy for embedded devices.
pub type BoxedFramedBinding<Endpoint> = ;
/// Trait generalizing a common feature of async libraries like tokio where a socket is exposed
/// as both a stream and a sink. It should be possible even for libraries that have them split
/// to unify in the bridging layer with this crate.
///
/// Note that this binding is intended to generalize cases like TCP and UDP together which is why
/// the abstraction doesn't have an additional layer for accepting an incoming connection. For
/// UDP there is no such concept and framed items can simply arrive at any time from any source.
/// Parsed CoAP packet coming from a remote peer, as designated by [`Endpoint`]. Note that
/// the endpoint is delivered with each packet so that packet-oriented protocols can
/// avoid the leaky abstraction of a "connection" to a given Endpoint.
pub type FramedItem<Endpoint> = ;
/// Error when receiving from a remote peer. Note that here [`Endpoint`] is optional as there may
/// be a generic read error unrelated to any remote peer, for example if the underlying bound
/// socket is closed.
pub type FramedReadError<Endpoint> = ;
/// Error when sending to a remote peer. Note that [`Endpoint`] is omitted in this case as the
/// endpoint is provided to the send APIs themselves so we can easily tell which peer generated
/// the error.
pub type FramedWriteError = TransportError;
/// Generalized errors indicating a range of transport-related issues such as being unable to bind,
/// disconnections from remote peers, malformed input, etc. Most of these errors are non-fatal
/// and the server can happily continue serving other customers.