pub struct FlowHeader {
pub endpoint: String,
pub flow: u64,
pub content_type: Option<String>,
pub traceparent: Option<String>,
pub tracestate: Option<String>,
pub topic: Option<String>,
}Expand description
FLOW header (kind 7).
The registration of a datagram flow: the stream it opens is the flow’s lifetime, and the flow id prefixes every datagram the flow carries (decisions/0034 §4.2). The optional keys reuse DATA’s meaning and caps.
Fields§
§endpoint: StringEndpoint path the flow is addressed to (key 0, required).
flow: u64Flow id, chosen by the sender and unique per connection and
direction (key 1, required).
content_type: Option<String>Opaque media type label (key 2).
traceparent: Option<String>W3C Trace Context traceparent (key 3).
tracestate: Option<String>W3C Trace Context tracestate (key 4).
topic: Option<String>Topic the flow carries (key 5).
Implementations§
Source§impl FlowHeader
impl FlowHeader
Sourcepub fn new(endpoint: impl Into<String>, flow: u64) -> FlowHeader
pub fn new(endpoint: impl Into<String>, flow: u64) -> FlowHeader
A header for flow flow addressed to endpoint, with no optional key.
Sourcepub fn check(&self) -> Result<(), HeaderError>
pub fn check(&self) -> Result<(), HeaderError>
Checks the text caps of the decoder, so a sender can refuse a header every conformant peer would close the connection over.
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.
Sourcepub fn decode(bytes: &[u8]) -> Result<FlowHeader, HeaderError>
pub fn decode(bytes: &[u8]) -> Result<FlowHeader, HeaderError>
Decodes the header.