#[non_exhaustive]pub enum StreamEvent {
Listening {
listener: ListenerId,
local: SocketAddr,
},
ListenFailed {
listener: ListenerId,
},
Connected {
id: StreamId,
local: SocketAddr,
},
ConnectFailed {
id: StreamId,
},
Written {
id: StreamId,
bytes: usize,
},
Closed {
id: StreamId,
},
Reset {
id: StreamId,
},
Resolved {
query: u64,
addresses: Vec<SocketAddr>,
},
ResolvedRecords {
query: u64,
records: Vec<DnsRecord>,
},
ResolvedFamily {
query: u64,
ipv6: bool,
addresses: Vec<SocketAddr>,
},
}Expand description
What the driver tells the engine about its sockets.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Listening
The listener is bound to local.
Fields
listener: ListenerIdThe listener’s id.
local: SocketAddrThe address it is bound to (the port chosen when the command asked for port 0).
ListenFailed
The listener could not be bound.
Fields
listener: ListenerIdThe listener’s id.
Connected
The connection is established from local.
Fields
local: SocketAddrIts local address (with the ephemeral port it got).
ConnectFailed
The connection could not be established (refused, unreachable, timed out).
Written
bytes more of the connection’s transmits have been written to the socket.
Closed
The connection is closed: the peer finished it (end of stream), or a close the engine asked for is done.
Reset
The connection broke (reset by the peer, or an I/O error).
Resolved
A StreamCommand::Resolve is answered: the addresses, empty when the name did not
resolve.
ResolvedRecords
A StreamCommand::ResolveRecords is answered (an empty list: none).
ResolvedFamily
One family of a StreamCommand::Resolve is answered (AAAA with ipv6, A without),
as it arrives: the engine starts on the first answer (RFC 8305 section 3). A driver
answers each family once, an empty list when it has none; or answers the whole query
once with StreamEvent::Resolved.