Skip to main content

Question

Struct Question 

Source
pub struct Question {
Show 52 fields pub id: Option<Iri>, pub attachments: Vec<LinkOrObjectOrPropertyValue>, pub attributions: Vec<AnyActor>, pub audiences: Vec<AnyObject>, pub content: Text, pub contexts: Vec<LinkOrObject>, pub name: Text, pub end_time: Option<String>, pub generators: Vec<LinkOrObject>, pub icons: Vec<Reference<Image>>, pub images: Vec<Reference<Image>>, pub reply_targets: Vec<LinkOrObject>, pub locations: Vec<LinkOrObject>, pub previews: Vec<LinkOrObject>, pub published: Option<String>, pub replies: Option<AnyCollection>, pub shares: Option<AnyCollection>, pub likes: Option<AnyCollection>, pub emoji_reactions: Option<AnyCollection>, pub start_time: Option<String>, pub summary: Text, pub tags: Vec<LinkOrObject>, pub updated: Option<String>, pub urls: Vec<LinkOrIri>, pub tos: Vec<AnyObject>, pub btos: Vec<AnyObject>, pub ccs: Vec<AnyObject>, pub bccs: Vec<AnyObject>, pub media_type: Option<String>, pub duration: Option<String>, pub sensitive: Option<bool>, pub source: Option<Box<Source>>, pub proofs: Vec<Reference<DataIntegrityProof>>, pub interaction_policy: Option<Box<InteractionPolicy>>, pub approved_by: Option<Iri>, pub like_authorization: Option<Reference<LikeAuthorization>>, pub reply_authorization: Option<Reference<ReplyAuthorization>>, pub announce_authorization: Option<Reference<AnnounceAuthorization>>, pub translations: Vec<Translation>, pub actors: Vec<AnyActor>, pub objects: Vec<AnyObject>, pub targets: Vec<AnyObject>, pub results: Vec<AnyObject>, pub origins: Vec<AnyObject>, pub instruments: Vec<AnyObject>, pub exclusive_options: Vec<AnyObject>, pub inclusive_options: Vec<AnyObject>, pub closed: Option<BooleanOrDateTime>, pub voters: Option<u64>, pub quote: Option<AnyObject>, pub quote_url: Option<Iri>, pub quote_authorization: Option<Reference<QuoteAuthorization>>,
}
Expand description

Represents a question being asked. Question objects are an extension of {@link IntransitiveActivity}. That is, the Question object is an Activity, but the direct object is the question itself and therefore it would not contain an object property.

The type https://www.w3.org/ns/activitystreams#Question.

Fields§

§id: Option<Iri>

The IRI that identifies this object.

§attachments: Vec<LinkOrObjectOrPropertyValue>§attributions: Vec<AnyActor>§audiences: Vec<AnyObject>§content: Text§contexts: Vec<LinkOrObject>§name: Text§end_time: Option<String>§generators: Vec<LinkOrObject>§icons: Vec<Reference<Image>>§images: Vec<Reference<Image>>§reply_targets: Vec<LinkOrObject>§locations: Vec<LinkOrObject>§previews: Vec<LinkOrObject>§published: Option<String>§replies: Option<AnyCollection>§shares: Option<AnyCollection>§likes: Option<AnyCollection>§emoji_reactions: Option<AnyCollection>§start_time: Option<String>§summary: Text§tags: Vec<LinkOrObject>§updated: Option<String>§urls: Vec<LinkOrIri>§tos: Vec<AnyObject>§btos: Vec<AnyObject>§ccs: Vec<AnyObject>§bccs: Vec<AnyObject>§media_type: Option<String>§duration: Option<String>§sensitive: Option<bool>§source: Option<Box<Source>>§proofs: Vec<Reference<DataIntegrityProof>>§interaction_policy: Option<Box<InteractionPolicy>>§approved_by: Option<Iri>§like_authorization: Option<Reference<LikeAuthorization>>§reply_authorization: Option<Reference<ReplyAuthorization>>§announce_authorization: Option<Reference<AnnounceAuthorization>>§translations: Vec<Translation>§actors: Vec<AnyActor>§objects: Vec<AnyObject>§targets: Vec<AnyObject>§results: Vec<AnyObject>§origins: Vec<AnyObject>§instruments: Vec<AnyObject>§exclusive_options: Vec<AnyObject>

Identifies an exclusive option for a Question. Use of exclusiveOptions implies that the Question can have only a single answer. To indicate that a Question can have multiple answers, use inclusiveOptions.

§inclusive_options: Vec<AnyObject>

Identifies an inclusive option for a Question. Use of inclusiveOptions implies that the Question can have multiple answers. To indicate that a Question can have only one answer, use exclusiveOptions.

§closed: Option<BooleanOrDateTime>

Indicates that a question has been closed, and answers are no longer accepted.

§voters: Option<u64>

How many people have voted in the poll. Distinct from how many votes have been cast (in the case of multiple-choice polls).

§quote: Option<AnyObject>

The quoted ActivityStreams object.

§quote_url: Option<Iri>

The URI of the ActivityStreams object that this object quotes.

§quote_authorization: Option<Reference<QuoteAuthorization>>

A {@link QuoteAuthorization} object that proves this quote was approved by the quoted object’s author.

Implementations§

Source§

impl Question

Source

pub const TYPE_IRI: &'static str = "https://www.w3.org/ns/activitystreams#Question"

The type’s IRI.

Source

pub const TYPE: &'static str = "Question"

The type’s type in a normalised document.

Trait Implementations§

Source§

impl Clone for Question

Source§

fn clone(&self) -> Question

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Question

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Question

Source§

fn default() -> Question

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Question

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl FromJson for Question

Source§

fn from_json(value: &Value) -> Result<Self, JsonError>

Read value. Read more
Source§

impl PartialEq for Question

Source§

fn eq(&self, other: &Question) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Post for Question

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.
Source§

impl Serialize for Question

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Question

Source§

impl ToJson for Question

Source§

fn to_json(&self) -> Value

Write self.
Source§

impl Typed for Question

Source§

const TYPE: &'static str = "Question"

The type’s type in a normalised document, such as Create.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.