A function that returns true if the message is valid and can be sent.
typedef MessageValidator = bool Function(Message message);