#[non_exhaustive]pub enum Received<'a> {
Group {
session_id: SessionId,
from: Peer,
},
SessionClosed {
session: SessionId,
},
Message {
exchange: ExchangeKey,
header: ProtocolHeader,
needs_ack: bool,
payload: &'a [u8],
},
Duplicate {
exchange: ExchangeKey,
needs_ack: bool,
},
Acknowledged {
exchange: ExchangeKey,
},
}rustcrypto only.Expand description
What arrived, once the message has been authenticated and routed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Group
A group datagram (§4.16), which belongs to the group key store rather than here.
Nothing about it has been decrypted or authenticated: a group message is keyed by an
operational group key, and which key it is has to be found by trying every installed
one whose session id matches (§4.17.3.6). Hand buf — unchanged — to
group::wire::receive, which does that and returns the
payload; a node that holds no group keys drops it.
Fields
SessionClosed
The peer closed the session, and this node has done the same (§4.11.1.4).
The session, its keys and its exchanges are gone by the time this is returned — that is what “SHALL remove all state associated with the session” means, and it is done here rather than left to the caller because none of that state is the caller’s.
What is the caller’s is everything keyed on a session above this layer: §8.5’s subscriptions above all, which report on a session and have nowhere to go once it has gone, and the §5.5 commissioning channel, which a closed PASE session releases.
Message
A protocol message for the layer above.
Fields
exchange: ExchangeKeyThe exchange it belongs to.
header: ProtocolHeaderThe protocol header it carried.
needs_ack: boolWhether an acknowledgement is owed, which Messaging::acknowledge sends.
Duplicate
An authenticated message this node has already seen (§4.12.2.2).
Not delivered upward. Still acknowledged, because the sender’s retransmission means its last acknowledgement was lost, not that its message was.
Fields
exchange: ExchangeKeyThe exchange it belongs to.
Acknowledged
A standalone acknowledgement, consumed entirely by the reliability layer.
Fields
exchange: ExchangeKeyThe exchange it acknowledged.