Enum hangouts_rs::ChatSegment[][src]

pub enum ChatSegment {
    Text {
        text: String,
        format: Formatting,
    },
    Link {
        text: String,
        target: String,
        display_url: Option<String>,
        format: Formatting,
    },
    LinkBreak {
        text: Option<String>,
        format: Formatting,
    },
}

A segment of a chat message.

Variants

Text

A pure-text message segment.

Fields of Text

text: String

Textual content of the segment.

format: Formatting

Formatting of the content.

A link segment.

Fields of Link

text: String

Text displayed as part of the message.

target: String

Target location of the url.

display_url: Option<String>format: Formatting

Formatting of the text content.

LinkBreak

A line-break in the middle of a message.

Fields of LinkBreak

text: Option<String>

Raw text of the line-break.

format: Formatting

Format of the text content.

Implementations

impl ChatSegment[src]

pub fn text(&self) -> &str[src]

Returns the text string of the segment.

pub fn formatting(&self) -> &Formatting[src]

Returns the Formatting of the segment.

pub fn is_text(&self) -> bool[src]

Returns true if the chat_segment is Self::Text.

Returns true if the chat_segment is Self::Link.

Returns true if the chat_segment is Self::LinkBreak.

Trait Implementations

impl Clone for ChatSegment[src]

impl Debug for ChatSegment[src]

impl From<ChatSegment> for ChatSegment[src]

impl PartialEq<ChatSegment> for ChatSegment[src]

impl StructuralPartialEq for ChatSegment[src]

Auto Trait Implementations

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.