pub struct Hello {
pub versions: Vec<u64>,
pub max_header_bytes: u64,
pub max_transfers: u64,
pub capabilities: Vec<u64>,
pub required_capabilities: Vec<u64>,
pub guarantees_offered: Option<GuaranteeSet>,
pub guarantees_required: Option<GuaranteeSet>,
}Expand description
HELLO header: connection negotiation input.
Fields§
§versions: Vec<u64>Wire protocol versions the sender supports.
max_header_bytes: u64Largest header the sender is willing to receive.
max_transfers: u64Advisory concurrent inbound transfer count.
capabilities: Vec<u64>Capability codes the sender supports.
required_capabilities: Vec<u64>Capability codes the sender requires the peer to support.
guarantees_offered: Option<GuaranteeSet>Guarantee set the sender can honour (key 5).
None means the default set: an absent key and
GuaranteeSet::CORE are the same declaration, which is why a v0
HELLO is unchanged on the wire.
guarantees_required: Option<GuaranteeSet>Guarantee set the sender requires of the peer (key 6).
MUST be reachable by guarantees_offered on every dimension: requiring
what you cannot honour yourself is a configuration error
(docs/PROTOCOL.md §6.1), and a decoder rejects it.
Implementations§
Source§impl Hello
impl Hello
Sourcepub fn v0(max_header_bytes: u64, max_transfers: u64) -> Hello
pub fn v0(max_header_bytes: u64, max_transfers: u64) -> Hello
The HELLO a v0 implementation sends: no guarantee declarations, so
core offered and core required.
Sourcepub fn offered(&self) -> GuaranteeSet
pub fn offered(&self) -> GuaranteeSet
The set this HELLO offers; an absent declaration means core.
Sourcepub fn required(&self) -> GuaranteeSet
pub fn required(&self) -> GuaranteeSet
The set this HELLO requires; an absent declaration means core.
Sourcepub fn encode_into(&self, out: &mut Vec<u8>)
pub fn encode_into(&self, out: &mut Vec<u8>)
Appends the encoded header to out, for a send path that reuses a
buffer (B-250). The canonical form has one implementation and this is
it; Self::encode is a wrapper.