feat: add message formatter
This commit is contained in:
parent
d2b65df7c5
commit
d884d8ba59
2 changed files with 14 additions and 1 deletions
|
@ -207,6 +207,10 @@ pub const message = struct {
|
|||
pub fn match(self: Self, m: anytype) error{Exit}!bool {
|
||||
return if (cbor.match(self.buf, m)) |ret| ret else |e| exit_error(e, @errorReturnTrace());
|
||||
}
|
||||
|
||||
pub fn format(self: @This(), comptime _: []const u8, _: std.fmt.FormatOptions, writer: anytype) !void {
|
||||
return cbor.toJsonWriter(self.buf, writer, .{});
|
||||
}
|
||||
};
|
||||
|
||||
pub fn exit_message(e: anytype, stack_trace: ?*std.builtin.StackTrace) message {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue