[][src]Struct mhteams::Message

pub struct Message<'a> { /* fields omitted */ }

Main object representing a teams message.

Implementations

impl<'a> Message<'a>[src]

pub fn new() -> Message<'a>[src]

Create a new, empty message.

The message @type and @context are automatically set upon creation, since these always have the same values.

pub fn summary(self, s: impl ToString) -> Self[src]

Required if the card does not contain a text property, otherwise optional. The summary property is typically displayed in the list view in Outlook, as a way to quickly determine what the card is all about.

Do always include a summary.

Don't include details in the summary. For example, for a Twitter post, a summary might simply read "New tweet from @someuser" without mentioning the content of the tweet itself.

pub fn theme_color(self, c: impl ToString) -> Self[src]

Specifies a custom brand color for the card. The color will be displayed in a non-obtrusive manner.

pub fn correlation_id(self, id: usize) -> Self[src]

The correlationId property simplifies the process of locating logs for troubleshooting issues. We recommend that when sending an actionable card, your service should set and log a unique UUID in this property.

When the user invokes an action on the card, Office 365 sends the Card-Correlation-Id and Action-Request-Id headers in the POST request to your service. Card-Correlation-Id contains the same value as the correlationId property in the card. Action-Request-Id is a unique UUID generated by Office 365 to help locate specific action performed by a user. Your service should log both of these values when receiving action POST requests.

pub fn expected_actors<I>(self, v: I) -> Self where
    I: IntoIterator,
    I::Item: ToString
[src]

Optional. This contains a list of expected email addresses of the recipient for the action endpoint.

A user can have multiple email addresses and the action endpoint might not be expecting the particular email address presented in the sub claim of the bearer token. For example, a user could have both the john.doe@contoso.com or john@contoso.com email address, but the action endpoint expects to receive john@contoso.com in the sub claim of the bearer token. By setting this field to ["john@contoso.com"], the sub claim will have the expected email address.

pub fn originator(self, s: impl ToString) -> Self[src]

Required when sent via email, not applicable when sent via connector. For actionable email, MUST be set to the provider ID generated by the Actionable Email Developer Dashboard.

pub fn hide_original_body(self, b: bool) -> Self[src]

Only applies to cards in email messages

When set to true, causes the HTML body of the message to be hidden. This is very useful in scenarios where the card is a better or more useful representation of the content than the HTML body itself, which is especially true when the card contains actions (see below.)

Consider hiding the original HTML body:

  • If the card itself contains all the information a user would need
  • If the content of the card is redundant with the content of the body

Do always include a nice HTML body, even if it is going to be hidden. The HTML body is the only thing an email client that doesn't support cards will be able to display. Furthermore, cards are not included when replying to or forwarding emails, only the HTML body.

Don't hide the body when it is complementary to the information presented in the card. For example, the body of an expense report approval might describe the report in great details while the card just presents a quick summary along with approve/decline actions.

pub fn title(self, s: impl ToString) -> Self[src]

The title property is meant to be rendered in a prominent way, at the very top of the card. Use it to introduce the content of the card in such a way users will immediately know what to expect.

Examples:

  • Daily news
  • New bug opened
  • Task assigned

Do keep title short, don't make it a long sentence.

Do mention the name of the entity being referenced in the title.

Don't use hyperlinks (via Markdown) in the title.

pub fn text(self, s: impl ToString) -> Self[src]

Required if the card does not contain a summary property, otherwise optional. The text property is meant to be displayed in a normal font below the card's title. Use it to display content, such as the description of the entity being referenced, or an abstract of a news article.

Do use simple Markdown, such as bold or italics to emphasize words, and links to external resources.

Don't include any call to action in the text property. Users should be able to not read it and still understand what the card is all about.

pub fn sections(self, v: Vec<Section>) -> Self[src]

A collection of sections to include in the card.

Trait Implementations

impl<'a> Clone for Message<'a>[src]

impl<'a> Debug for Message<'a>[src]

impl<'a> Default for Message<'a>[src]

impl<'a> Eq for Message<'a>[src]

impl<'a> PartialEq<Message<'a>> for Message<'a>[src]

impl<'a> Serialize for Message<'a>[src]

impl<'a> StructuralEq for Message<'a>[src]

impl<'a> StructuralPartialEq for Message<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Message<'a>

impl<'a> Send for Message<'a>

impl<'a> Sync for Message<'a>

impl<'a> Unpin for Message<'a>

impl<'a> UnwindSafe for Message<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.