Struct activitystreams::activity::Question
source · pub struct Question { /* private fields */ }
Expand description
Represents a question being asked.
Question objects are an extension of 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.
Either of the anyOf and oneOf properties MAY be used to express possible answers, but a Question object MUST NOT have both properties.
Implementations§
source§impl Question
impl Question
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new Question Activity
use activitystreams::activity::Question;
let activity = Question::new();
sourcepub fn into_parts(
self
) -> (Option<OneOrMany<AnyBase>>, Option<OneOrMany<AnyBase>>, Activity<QuestionType>)
pub fn into_parts(
self
) -> (Option<OneOrMany<AnyBase>>, Option<OneOrMany<AnyBase>>, Activity<QuestionType>)
Deconstruct the Question into its parts
use activitystreams::activity::Question;
let activity = Question::new();
let (one_of, any_of, activity) = activity.into_parts();
Trait Implementations§
source§impl AsActivity for Question
impl AsActivity for Question
type Kind = QuestionType
source§fn activity_ref(&self) -> &Activity<QuestionType>
fn activity_ref(&self) -> &Activity<QuestionType>
Immutable borrow of
Activity<Kind>
source§fn activity_mut(&mut self) -> &mut Activity<QuestionType>
fn activity_mut(&mut self) -> &mut Activity<QuestionType>
Mutable borrow of
Activity<Kind>
source§impl AsQuestion for Question
impl AsQuestion for Question
source§fn question_ref(&self) -> &Question
fn question_ref(&self) -> &Question
Immutable borrow of Question
source§fn question_mut(&mut self) -> &mut Question
fn question_mut(&mut self) -> &mut Question
Mutable borrow of Question
source§impl<'de> Deserialize<'de> for Question
impl<'de> Deserialize<'de> for Question
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl UnparsedMut for Question
impl UnparsedMut for Question
source§fn unparsed_mut(&mut self) -> &mut Unparsed
fn unparsed_mut(&mut self) -> &mut Unparsed
Get a mutable reference to Unparsed
impl Activity for Question
impl Base for Question
impl IntransitiveActivity for Question
impl Object for Question
Auto Trait Implementations§
impl RefUnwindSafe for Question
impl Send for Question
impl Sync for Question
impl Unpin for Question
impl UnwindSafe for Question
Blanket Implementations§
source§impl<T> ActivityExt for Twhere
T: AsActivity,
impl<T> ActivityExt for Twhere
T: AsActivity,
source§fn result<'a>(&'a self) -> Option<&'a OneOrMany<AnyBase>>where
Self::Kind: 'a,
fn result<'a>(&'a self) -> Option<&'a OneOrMany<AnyBase>>where
Self::Kind: 'a,
Fetch the result for the current activity Read more
source§fn set_result<T>(&mut self, result: T) -> &mut Selfwhere
T: Into<AnyBase>,
fn set_result<T>(&mut self, result: T) -> &mut Selfwhere
T: Into<AnyBase>,
Set the result for the current activity Read more
source§fn set_many_results<I, T>(&mut self, items: I) -> &mut Selfwhere
I: IntoIterator<Item = T>,
T: Into<AnyBase>,
fn set_many_results<I, T>(&mut self, items: I) -> &mut Selfwhere
I: IntoIterator<Item = T>,
T: Into<AnyBase>,
Set many results for the current activity Read more
source§fn add_result<T>(&mut self, result: T) -> &mut Selfwhere
T: Into<AnyBase>,
fn add_result<T>(&mut self, result: T) -> &mut Selfwhere
T: Into<AnyBase>,
Add a result to the current activity Read more
source§fn take_result(&mut self) -> Option<OneOrMany<AnyBase>>
fn take_result(&mut self) -> Option<OneOrMany<AnyBase>>
Take the result from the current activity, leaving nothing Read more
source§fn delete_result(&mut self) -> &mut Self
fn delete_result(&mut self) -> &mut Self
Delete the result from the current activity Read more
source§fn instrument<'a>(&'a self) -> Option<&'a OneOrMany<AnyBase>>where
Self::Kind: 'a,
fn instrument<'a>(&'a self) -> Option<&'a OneOrMany<AnyBase>>where
Self::Kind: 'a,
Fetch the instrument for the current activity Read more
source§fn set_instrument<T>(&mut self, instrument: T) -> &mut Selfwhere
T: Into<AnyBase>,
fn set_instrument<T>(&mut self, instrument: T) -> &mut Selfwhere
T: Into<AnyBase>,
Set the instrument for the current activity Read more
source§fn set_many_instruments<I, T>(&mut self, items: I) -> &mut Selfwhere
I: IntoIterator<Item = T>,
T: Into<AnyBase>,
fn set_many_instruments<I, T>(&mut self, items: I) -> &mut Selfwhere
I: IntoIterator<Item = T>,
T: Into<AnyBase>,
Set many instruments for the current activity Read more
source§fn add_instrument<T>(&mut self, instrument: T) -> &mut Selfwhere
T: Into<AnyBase>,
fn add_instrument<T>(&mut self, instrument: T) -> &mut Selfwhere
T: Into<AnyBase>,
Add a instrument to the current activity Read more
source§fn take_instrument(&mut self) -> Option<OneOrMany<AnyBase>>
fn take_instrument(&mut self) -> Option<OneOrMany<AnyBase>>
Take the instrument from the current activity, leaving nothing Read more
source§fn delete_instrument(&mut self) -> &mut Self
fn delete_instrument(&mut self) -> &mut Self
Delete the instrument from the current activity Read more
source§impl<T> QuestionExt for Twhere
T: AsQuestion,
impl<T> QuestionExt for Twhere
T: AsQuestion,
source§fn one_of(&self) -> Option<&OneOrMany<AnyBase>>
fn one_of(&self) -> Option<&OneOrMany<AnyBase>>
Fetch the one_of field for the current activity Read more
source§fn set_one_of<T>(&mut self, one_of: T) -> &mut Selfwhere
T: Into<AnyBase>,
fn set_one_of<T>(&mut self, one_of: T) -> &mut Selfwhere
T: Into<AnyBase>,
Set the one_of field for the current activity Read more
source§fn set_many_one_ofs<I, T>(&mut self, items: I) -> &mut Selfwhere
I: IntoIterator<Item = T>,
T: Into<AnyBase>,
fn set_many_one_ofs<I, T>(&mut self, items: I) -> &mut Selfwhere
I: IntoIterator<Item = T>,
T: Into<AnyBase>,
Set many one_of items for the current activity Read more
source§fn add_one_of<T>(&mut self, one_of: T) -> &mut Selfwhere
T: Into<AnyBase>,
fn add_one_of<T>(&mut self, one_of: T) -> &mut Selfwhere
T: Into<AnyBase>,
Add a one_of to the current activity Read more
source§fn take_one_of(&mut self) -> Option<OneOrMany<AnyBase>>
fn take_one_of(&mut self) -> Option<OneOrMany<AnyBase>>
Take the one_of field from the current activity, leaving nothing Read more
source§fn delete_one_of(&mut self) -> &mut Self
fn delete_one_of(&mut self) -> &mut Self
Delete the one_of field from the current activity Read more
source§fn any_of(&self) -> Option<&OneOrMany<AnyBase>>
fn any_of(&self) -> Option<&OneOrMany<AnyBase>>
Fetch the any_of field for the current activity Read more
source§fn set_any_of<T>(&mut self, any_of: T) -> &mut Selfwhere
T: Into<AnyBase>,
fn set_any_of<T>(&mut self, any_of: T) -> &mut Selfwhere
T: Into<AnyBase>,
Set the any_of field for the current activity Read more
source§fn set_many_any_ofs<I, T>(&mut self, items: I) -> &mut Selfwhere
I: IntoIterator<Item = T>,
T: Into<AnyBase>,
fn set_many_any_ofs<I, T>(&mut self, items: I) -> &mut Selfwhere
I: IntoIterator<Item = T>,
T: Into<AnyBase>,
Set many any_of items for the current activity Read more
source§fn add_any_of<T>(&mut self, any_of: T) -> &mut Selfwhere
T: Into<AnyBase>,
fn add_any_of<T>(&mut self, any_of: T) -> &mut Selfwhere
T: Into<AnyBase>,
Add an any_of to the current activity Read more
source§fn take_any_of(&mut self) -> Option<OneOrMany<AnyBase>>
fn take_any_of(&mut self) -> Option<OneOrMany<AnyBase>>
Take the any_of field from the current activity, leaving nothing Read more
source§fn delete_any_of(&mut self) -> &mut Self
fn delete_any_of(&mut self) -> &mut Self
Delete the any_of field from the current activity Read more
source§fn closed(
&self
) -> Option<Either<&OneOrMany<AnyBase>, Either<OffsetDateTime, bool>>>
fn closed(
&self
) -> Option<Either<&OneOrMany<AnyBase>, Either<OffsetDateTime, bool>>>
Fetch the closed field for the current activity Read more
source§fn set_closed_base<T>(&mut self, closed: T) -> &mut Selfwhere
T: Into<AnyBase>,
fn set_closed_base<T>(&mut self, closed: T) -> &mut Selfwhere
T: Into<AnyBase>,
Set the closed field for the current activity Read more
source§fn set_many_closed_bases<I, T>(&mut self, closed: I) -> &mut Selfwhere
I: IntoIterator<Item = T>,
T: Into<AnyBase>,
fn set_many_closed_bases<I, T>(&mut self, closed: I) -> &mut Selfwhere
I: IntoIterator<Item = T>,
T: Into<AnyBase>,
Set many closed items for the current activity Read more
source§fn set_closed_date(&mut self, closed: OffsetDateTime) -> &mut Self
fn set_closed_date(&mut self, closed: OffsetDateTime) -> &mut Self
Set the closed field as a date Read more
source§fn set_closed_bool(&mut self, closed: bool) -> &mut Self
fn set_closed_bool(&mut self, closed: bool) -> &mut Self
Set the closed field as a boolean Read more
source§fn add_closed_base<T>(&mut self, closed: T) -> &mut Selfwhere
T: Into<AnyBase>,
fn add_closed_base<T>(&mut self, closed: T) -> &mut Selfwhere
T: Into<AnyBase>,
Add an object or link to the closed field Read more
source§fn take_closed(
&mut self
) -> Option<Either<OneOrMany<AnyBase>, Either<OffsetDateTime, bool>>>
fn take_closed(
&mut self
) -> Option<Either<OneOrMany<AnyBase>, Either<OffsetDateTime, bool>>>
Take the closed field from the current activity Read more
source§fn delete_closed(&mut self) -> &mut Self
fn delete_closed(&mut self) -> &mut Self
Remove the closed field from the current activity Read more