Skip to main content

Post

Trait Post 

Source
pub trait Post {
    // Required methods
    fn content_warning(&self) -> Option<&str>;
    fn is_sensitive(&self) -> bool;
    fn mentions(&self) -> Vec<Mention<'_>>;
    fn hashtags(&self) -> Vec<&str>;
    fn quote(&self) -> Option<&Iri>;
}
Expand description

What a post says, the same way for every kind of post.

Required Methods§

Source

fn content_warning(&self) -> Option<&str>

The post’s content warning: its summary, which Mastodon and Misskey both show in front of the content, collapsed. None when it has none.

Source

fn is_sensitive(&self) -> bool

Whether the post’s media is marked sensitive.

Source

fn mentions(&self) -> Vec<Mention<'_>>

The people the post mentions, from its tag.

Source

fn hashtags(&self) -> Vec<&str>

The hashtags the post carries, from its tag, without their #.

Source

fn quote(&self) -> Option<&Iri>

The post this one quotes: FEP-044f’s quote, and failing that the property Misskey (_misskey_quote), Fedibird (quoteUri) or Akkoma (quoteUrl) sends it under, which reading merges into one.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§