pars 0.2.1
Loading...
Searching...
No Matches
std::formatter< nngxx::msg > Struct Reference

#include <nng.h>

Inheritance diagram for std::formatter< nngxx::msg >:
Collaboration diagram for std::formatter< nngxx::msg >:

Public Member Functions

auto format (const nngxx::msg &m, format_context &ctx) const -> decltype(ctx.out())
 

Detailed Description

Definition at line 42 of file nng.h.

Member Function Documentation

◆ format()

auto std::formatter< nngxx::msg >::format ( const nngxx::msg & m,
format_context & ctx ) const -> decltype(ctx.out())
inline

Definition at line 44 of file nng.h.

46 {
47 if (m.body().size() < sizeof(std::size_t))
48 {
49 return std::format_to(
50 ctx.out(), "size:{}={}+{}, hash:<error>, pipe:0x{:X}",
51 m.header().size() + m.body().size(), m.header().size(), m.body().size(),
52 m.get_pipe().id());
53 }
54 else
55 {
56 std::size_t h = pars::hash_from_msg(m);
57
58 return std::format_to(
59 ctx.out(), "size:{}={}+{}, hash:0x{:X}, pipe:0x{:X}",
60 m.header().size() + m.body().size(), m.header().size(), m.body().size(),
61 h, m.get_pipe().id());
62 }
63 }

The documentation for this struct was generated from the following file: