namespace AIStudio.Tools; /// /// What one receiver says to a question on the message bus, cf. MessageBus.SendMessageUseFirstResult. /// /// /// A bare result cannot tell an answer apart from "this is not my question". Most receivers are components /// which never narrow down their events, so every question reaches them, and the default they return looks /// like an answer: for a bool, it is false. Such a false used to drown out the chat, the only receiver which /// knows whether it has unsaved changes, and the warning about them appeared only by chance. That is why a /// receiver states that it answers, and every other one returns NONE. /// /// True, when the receiver handles the question. /// The answer. It means nothing unless IsAnswered is true. /// The type of the answer. public readonly record struct MessageBusAnswer(bool IsAnswered, TResult? Value) { /// /// The receiver does not handle this question. /// public static readonly MessageBusAnswer NONE = new(false, default); }