pub trait Message {
// Provided methods
fn text(self) -> String
where Self: Sized { ... }
fn structured<S: Serializer>(self, ser: S) -> Result<S::Ok, S::Error>
where Self: Sized { ... }
}Expand description
A typed object that can be either printed as a human-readable message or serialized as JSON.
The TypedMessage and Status
structs are the most frequently used kinds of messages.
Provided Methods§
Sourcefn text(self) -> Stringwhere
Self: Sized,
fn text(self) -> Stringwhere
Self: Sized,
Return textual representation of this message.
Default implementation returns empty string, making Ui skip printing this message.
Sourcefn structured<S: Serializer>(self, ser: S) -> Result<S::Ok, S::Error>where
Self: Sized,
fn structured<S: Serializer>(self, ser: S) -> Result<S::Ok, S::Error>where
Self: Sized,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.