pub struct Message {
pub id: i32,
pub format: String,
pub variables: HashMap<String, String>,
pub send_telemetry: bool,
pub show_user: bool,
pub url: Option<String>,
pub url_label: Option<String>,
/* private fields */
}
Expand description
A structured message object. Used to return errors from requests.
Fields§
§id: i32
Unique identifier for the message.
format: String
A format string for the message. Embedded variables have the form ‘{name}’.
If variable name starts with an underscore character, the variable does not contain user data (PII) and can be safely used for telemetry purposes.
variables: HashMap<String, String>
An object used as a dictionary for looking up the variables in the format string.
send_telemetry: bool
If true send to telemetry.
show_user: bool
If true show user.
url: Option<String>
An optional url where additional information about this message can be found.
url_label: Option<String>
An optional label that is presented to the user as the UI for opening the url.
Implementations§
Source§impl Message
impl Message
Sourcepub fn builder() -> MessageBuilder<((), (), (), (), (), (), ())>
pub fn builder() -> MessageBuilder<((), (), (), (), (), (), ())>
Create a builder for building Message
.
On the builder, call .id(...)
, .format(...)
, .variables(...)
(optional), .send_telemetry(...)
(optional), .show_user(...)
(optional), .url(...)
(optional), .url_label(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of Message
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.