Macro zenoh::keformat

source ·
keformat!() { /* proc-macro */ }
Expand description

Write a set of values into a Formatter and then builds it into an OwnedKeyExpr, stopping as soon as a value doesn’t fit the specification for its field.

keformat!($formatter, $($ident [= $expr]),*) will attempt to write $expr into their respective $ident fields for $formatter. $formatter must be an expression that dereferences to &mut Formatter. $expr must resolve to a value that implements core::fmt::Display. $expr defaults to $ident if omitted.

This macro always results in an expression that resolves to ZResult<OwnedKeyExpr>, and leaves $formatter in its written state.