pub trait Message {
// Required method
fn typename() -> &'static str;
// Provided methods
fn to_map(&self) -> Result<Map<String, Value>, Error>
where Self: Serialize + Sized { ... }
fn from_map(map: &Map<String, Value>) -> Result<Self, Error>
where Self: DeserializeOwned { ... }
}Expand description
A trait that must be implemented by all messages.
Messages sent to and received from Google Cloud services may be wrapped in
Any. Any uses a @type field to encoding the type
name and then validates extraction and insertion against this type.
Required Methods§
Provided Methods§
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.