[][src]Struct mhteams::Section

pub struct Section { /* fields omitted */ }

A section in a message.

Implementations

impl Section[src]

pub fn new() -> Self[src]

Create a new, empty section.

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

The title property of a section is displayed in a font that stands out while not as prominent as the card's title. It is meant to introduce the section and summarize its content, similarly to how the card's title property is meant to summarize the whole card.

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 start_group(self, b: bool) -> Self[src]

When set to true, the startGroup property marks the start of a logical group of information. Typically, sections with startGroup set to true will be visually separated from previous card elements. For example, Outlook uses a subtle horizontal separation line.

Do use startGroup to separate sections that represent different objects; for example, multiple tweets in a digest.

pub fn activity_image(self, url: impl ToString) -> Self[src]

These four properties form a logical group. activityTitle, activitySubtitle and activityText will be displayed alongside activityImage, using a layout appropriate for the form factor of the device the card is being viewed on. For instance, in Outlook on the Web, activityTitle, activitySubtitle and activityText are displayed on the right of activityImage, using a two-column layout.

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

These four properties form a logical group. activityTitle, activitySubtitle and activityText will be displayed alongside activityImage, using a layout appropriate for the form factor of the device the card is being viewed on. For instance, in Outlook on the Web, activityTitle, activitySubtitle and activityText are displayed on the right of activityImage, using a two-column layout.

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

These four properties form a logical group. activityTitle, activitySubtitle and activityText will be displayed alongside activityImage, using a layout appropriate for the form factor of the device the card is being viewed on. For instance, in Outlook on the Web, activityTitle, activitySubtitle and activityText are displayed on the right of activityImage, using a two-column layout.

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

These four properties form a logical group. activityTitle, activitySubtitle and activityText will be displayed alongside activityImage, using a layout appropriate for the form factor of the device the card is being viewed on. For instance, in Outlook on the Web, activityTitle, activitySubtitle and activityText are displayed on the right of activityImage, using a two-column layout.

pub fn hero_image(self, i: Image) -> Self[src]

Use heroImage to make an image the centerpiece of your card. For example, a tweet that contains an image will want to put that image front and center.

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

The section's text property is very similar to the text property of the card. It can be used for the same purpose.

pub fn facts(self, f: Vec<Fact>) -> Self[src]

Facts are a very important component of a section. They often contain the information that really matters to the user.

Facts are displayed in such a way that they can be read quickly and efficiently. For example, in Outlook on the Web, facts are presented in a two-column layout, with fact names rendered in a slightly more prominent font.

Do use facts instead of embedding important information inside the text property of either the card or the section.

Do keep fact names short.

Avoid making fact values too long.

Avoid using Markdown formatting for both fact names and values. Let facts be rendered as intended as that is how they will have the most impact.

Do however use Markdown for links in fact values only. For instance, if a fact references an external document, make the value of that fact a link to the document.

Don't add a fact without a real purpose. For instance, a fact that would always have the same value across all cards is not interesting and a waste of space.

pub fn images(self, i: Vec<Image>) -> Self[src]

The images property allows for the inclusion of a photo gallery inside a section. That photo gallery will always be displayed in a way that is easy to consume regardless of the form factor of the device it is being viewed on. For instance, in Outlook on the Web, images might be displayed as a horizontal strip of thumbnails with controls allowing to scroll through the collection if it doesn't all fit on the screen. On mobile, images might be displayed as a single thumbnail, with the user able to swipe through the collection with their finger.

Trait Implementations

impl Clone for Section[src]

impl Debug for Section[src]

impl Default for Section[src]

impl Eq for Section[src]

impl PartialEq<Section> for Section[src]

impl Serialize for Section[src]

impl StructuralEq for Section[src]

impl StructuralPartialEq for Section[src]

Auto Trait Implementations

impl RefUnwindSafe for Section

impl Send for Section

impl Sync for Section

impl Unpin for Section

impl UnwindSafe for Section

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.