From 8cf731089e70c6092aa600310aab6c2dc0499570 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Thu, 30 Mar 2023 18:26:34 +0200 Subject: [PATCH] Encoding - Implemented `toString()` in `TaggedMessage` --- source/tristanable/encoding.d | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/tristanable/encoding.d b/source/tristanable/encoding.d index 72d1197..64005c3 100644 --- a/source/tristanable/encoding.d +++ b/source/tristanable/encoding.d @@ -1,5 +1,7 @@ module tristanable.encoding; +import std.conv : to; + /** * Represents a tagged message that has been decoded * from its raw byte encoding, this is a tuple of @@ -184,6 +186,16 @@ public final class TaggedMessage { this.tag = newTag; } + + /** + * Returns a string representation of the TaggedMessage + * + * Returns: the string represenation + */ + public override string toString() + { + return "TMessage [Tag: "~to!(string)(tag)~", Payload: "~to!(string)(data)~"]"; + } } /**