[][src]Struct egg_mode::entities::MediaEntity

pub struct MediaEntity {
    pub display_url: String,
    pub expanded_url: String,
    pub id: i64,
    pub indices: (i32, i32),
    pub media_url: String,
    pub media_url_https: String,
    pub sizes: MediaSizes,
    pub source_status_id: Option<i64>,
    pub media_type: MediaType,
    pub url: String,
    pub video_info: Option<VideoInfo>,
}

Represents a piece of media attached to a tweet.

The information in this struct is subtly different depending on what media is being referenced, and which entity container is holding this instance. For videos and GIFs, the media_url and media_url_https fields each link to a thumbnail image of the media, typically of the first frame. The real video information can be found on the video_info field, including various encodings if available.

Image links available in media_url and media_url_https can be obtained in different sizes by appending a colon and one of the available sizes in the MediaSizes struct. For example, the cropped thumbnail can be viewed by appending :thumb to the end of the URL, and the full-size image can be viewed by appending :large.

Fields

A shortened URL to display to clients.

An expanded version of display_url; links to the media display page.

A numeric ID for the media.

Character indices where the media URL is located. The first index is the location of the first character of the URL; the second is the location of the first character following the URL.

A URL pointing directly to the media file. Uses HTTP as the protocol.

For videos and GIFs, this link will be to a thumbnail of the media, and the real video link will be contained in video_info.

A URL pointing directly to the media file. Uses HTTPS as the protocol.

For videos and GIFs, this link will be to a thumbnail of the media, and the real video link will be contained in video_info.

Various sizes available for the media file.

For tweets containing media that was originally associated with a different tweet, this contains the ID of the original tweet.

The type of media being represented.

The t.co link from the original text.

For media entities corresponding to videos, this contains extra information about the linked video.

Trait Implementations

impl Debug for MediaEntity
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for MediaEntity

impl Sync for MediaEntity

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

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

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

Mutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Typeable for T where
    T: Any
[src]

Get the TypeId of this object.