Enum gm_types::messages::Message [] [src]

pub enum Message {
    Text {
        body: String,
        formatted_body: Option<String>,
        format: Option<String>,
    },
    Notice {
        body: String,
        formatted_body: Option<String>,
        format: Option<String>,
    },
    Image {
        body: String,
        url: String,
        info: Option<ImageInfo>,
        thumbnail_url: Option<String>,
        thumbnail_info: Option<ImageInfo>,
    },
    Emote {
        body: String,
    },
    File {
        body: String,
        filename: String,
        info: Option<FileInfo>,
        thumbnail_info: Option<ImageInfo>,
        thumbnail_url: Option<String>,
        url: String,
    },
    Location {
        body: String,
        geo_uri: String,
    },
    Audio {
        body: String,
        url: String,
        info: Option<AudioInfo>,
    },
    Video {
        body: String,
        url: String,
        info: Option<VideoInfo>,
    },
}

A message sent to a room.

Variants

This message is the most basic message and is used to represent text.

Fields of Text

The body of the message.

The formatted body of the message (if the message is formatted).

The format of the formatted body (if the message is formatted).

A m.notice message should be considered similar to a plain m.text message except that clients should visually distinguish it in some way. It is intended to be used by automated clients, such as bots, bridges, and other entities, rather than humans. Additionally, such automated agents which watch a room for messages and respond to them ought to ignore m.notice messages. This helps to prevent infinite-loop situations where two automated clients continuously exchange messages, as each responds to the other.

Fields of Notice

The notice text to send.

The formatted body of the message (if the message is formatted).

The format of the formatted body (if the message is formatted).

This message represents a single image and an optional thumbnail. Information about an image and it's thumbnail.

Fields of Image

A textual representation of the image. This could be the alt text of the image, the filename of the image, or some kind of content description for accessibility e.g. 'image attachment'.

The URL to the image.

Metadata about the image referred to in url.

The URL to the thumbnail of the image.

Metadata about the image referred to in thumbnail_url.

This message is similar to m.text except that the sender is 'performing' the action contained in the body key, similar to /me in IRC. This message should be prefixed by the name of the sender. This message could also be represented in a different colour to distinguish it from regular m.text messages.

Fields of Emote

The emote action to perform.

This message represents a generic file.

Fields of File

A human-readable description of the file. This is recommended to be the filename of the original upload.

The original filename of the uploaded file.

Information about the file referred to in url.

Metadata about the image referred to in thumbnail_url.

The URL to the thumbnail of the file.

The URL to the file.

This message represents a real-world location.

Fields of Location

A description of the location e.g. 'Big Ben, London, UK', or some kind of content description for accessibility e.g. 'location attachment'.

A geo URI representing this location.

This message represents a single audio clip.

Fields of Audio

A description of the audio e.g. 'Bee Gees - Stayin' Alive', or some kind of content description for accessibility e.g. 'audio attachment'.

The URL to the audio clip.

Metadata for the audio clip referred to in url.

This message represents a single video clip.

Fields of Video

A description of the video e.g. 'Gangnam style', or some kind of content description for accessibility e.g. 'video attachment'.

The URL to the video clip.

Metadata about the video clip referred to in url.

Trait Implementations

impl Debug for Message
[src]

[src]

Formats the value using the given formatter.