Skip to main content

DiscussionTopic

Struct DiscussionTopic 

Source
pub struct DiscussionTopic {
Show 23 fields pub id: u64, pub course_id: Option<u64>, pub title: Option<String>, pub message: Option<String>, pub html_url: Option<String>, pub posted_at: Option<DateTime<Utc>>, pub last_reply_at: Option<DateTime<Utc>>, pub require_initial_post: Option<bool>, pub user_can_see_posts: Option<bool>, pub discussion_subentry_count: Option<u64>, pub read_state: Option<String>, pub unread_count: Option<u64>, pub subscribed: Option<bool>, pub discussion_type: Option<String>, pub published: Option<bool>, pub locked: Option<bool>, pub pinned: Option<bool>, pub locked_for_user: Option<bool>, pub assignment_id: Option<u64>, pub delayed_post_at: Option<DateTime<Utc>>, pub due_at: Option<DateTime<Utc>>, pub course_id_ctx: Option<u64>, pub group_id: Option<u64>, /* private fields */
}
Expand description

A Canvas discussion topic (announcement or discussion board post).

Fields§

§id: u64§course_id: Option<u64>§title: Option<String>§message: Option<String>§html_url: Option<String>§posted_at: Option<DateTime<Utc>>§last_reply_at: Option<DateTime<Utc>>§require_initial_post: Option<bool>§user_can_see_posts: Option<bool>§discussion_subentry_count: Option<u64>§read_state: Option<String>§unread_count: Option<u64>§subscribed: Option<bool>§discussion_type: Option<String>§published: Option<bool>§locked: Option<bool>§pinned: Option<bool>§locked_for_user: Option<bool>§assignment_id: Option<u64>§delayed_post_at: Option<DateTime<Utc>>§due_at: Option<DateTime<Utc>>§course_id_ctx: Option<u64>§group_id: Option<u64>

Implementations§

Source§

impl DiscussionTopic

Source

pub async fn update( &self, params: UpdateDiscussionParams, ) -> Result<DiscussionTopic>

Update this discussion topic.

§Canvas API

PUT /api/v1/courses/:course_id/discussion_topics/:id

Source

pub async fn delete(&self) -> Result<()>

Delete this discussion topic.

§Canvas API

DELETE /api/v1/courses/:course_id/discussion_topics/:id

Source

pub async fn post_entry( &self, params: PostEntryParams, ) -> Result<DiscussionEntry>

Post a new top-level entry to this discussion topic.

§Canvas API

POST /api/v1/courses/:course_id/discussion_topics/:id/entries

Source

pub fn get_topic_entries(&self) -> PageStream<DiscussionEntry>

Stream all top-level entries of this topic.

§Canvas API

GET /api/v1/courses/:course_id/discussion_topics/:id/entries

Source

pub async fn get_entries(&self, ids: &[u64]) -> Result<Vec<DiscussionEntry>>

Fetch specific entries by ID.

§Canvas API

GET /api/v1/courses/:course_id/discussion_topics/:id/entry_list?ids[]=...

Source

pub async fn mark_as_read(&self) -> Result<()>

Mark this topic as read.

§Canvas API

PUT /api/v1/courses/:course_id/discussion_topics/:id/read

Source

pub async fn mark_as_unread(&self) -> Result<()>

Mark this topic as unread.

§Canvas API

DELETE /api/v1/courses/:course_id/discussion_topics/:id/read

Source

pub async fn mark_entries_as_read(&self, forced: bool) -> Result<()>

Mark all entries as read.

§Canvas API

PUT /api/v1/courses/:course_id/discussion_topics/:id/read_all

Source

pub async fn mark_entries_as_unread(&self, forced: bool) -> Result<()>

Mark all entries as unread.

§Canvas API

DELETE /api/v1/courses/:course_id/discussion_topics/:id/read_all

Source

pub async fn subscribe(&self) -> Result<()>

Subscribe to this topic.

§Canvas API

PUT /api/v1/courses/:course_id/discussion_topics/:id/subscribed

Source

pub async fn unsubscribe(&self) -> Result<()>

Unsubscribe from this topic.

§Canvas API

DELETE /api/v1/courses/:course_id/discussion_topics/:id/subscribed

Trait Implementations§

Source§

impl Clone for DiscussionTopic

Source§

fn clone(&self) -> DiscussionTopic

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 DiscussionTopic

Source§

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

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

impl<'de> Deserialize<'de> for DiscussionTopic

Source§

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 Serialize for DiscussionTopic

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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