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 encode_into(&self, out: &mut Vec<u8>)
pub fn encode_into(&self, out: &mut Vec<u8>)
Appends the encoded header to out. The canonical form has one
implementation and this is it; Self::encode is a wrapper.
Sourcepub fn decode(bytes: &[u8]) -> Result<FlowHeader, HeaderError>
pub fn decode(bytes: &[u8]) -> Result<FlowHeader, HeaderError>
Decodes the header.
Trait Implementations§
Source§impl Clone for FlowHeader
impl Clone for FlowHeader
Source§impl Debug for FlowHeader
impl Debug for FlowHeader
impl Eq for FlowHeader
Source§impl PartialEq for FlowHeader
impl PartialEq for FlowHeader
impl StructuralPartialEq for FlowHeader
Auto Trait Implementations§
impl Freeze for FlowHeader
impl RefUnwindSafe for FlowHeader
impl Send for FlowHeader
impl Sync for FlowHeader
impl Unpin for FlowHeader
impl UnsafeUnpin for FlowHeader
impl UnwindSafe for FlowHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more