pub struct Course {Show 22 fields
pub id: u64,
pub name: Option<String>,
pub course_code: Option<String>,
pub workflow_state: Option<WorkflowState>,
pub account_id: Option<u64>,
pub root_account_id: Option<u64>,
pub enrollment_term_id: Option<u64>,
pub sis_course_id: Option<String>,
pub start_at: Option<DateTime<Utc>>,
pub end_at: Option<DateTime<Utc>>,
pub grading_standard_id: Option<u64>,
pub is_public: Option<bool>,
pub license: Option<String>,
pub locale: Option<String>,
pub time_zone: Option<String>,
pub total_students: Option<u64>,
pub default_view: Option<String>,
pub syllabus_body: Option<String>,
pub public_description: Option<String>,
pub hide_final_grades: Option<bool>,
pub apply_assignment_group_weights: Option<bool>,
pub restrict_enrollments_to_course_dates: Option<bool>,
/* private fields */
}Fields§
§id: u64§name: Option<String>§course_code: Option<String>§workflow_state: Option<WorkflowState>§account_id: Option<u64>§root_account_id: Option<u64>§enrollment_term_id: Option<u64>§sis_course_id: Option<String>§start_at: Option<DateTime<Utc>>§end_at: Option<DateTime<Utc>>§grading_standard_id: Option<u64>§is_public: Option<bool>§license: Option<String>§locale: Option<String>§time_zone: Option<String>§total_students: Option<u64>§default_view: Option<String>§syllabus_body: Option<String>§public_description: Option<String>§hide_final_grades: Option<bool>§apply_assignment_group_weights: Option<bool>§restrict_enrollments_to_course_dates: Option<bool>Implementations§
Source§impl Course
impl Course
Sourcepub fn get_assignments(&self) -> PageStream<Assignment>
pub fn get_assignments(&self) -> PageStream<Assignment>
Sourcepub async fn get_assignment(&self, assignment_id: u64) -> Result<Assignment>
pub async fn get_assignment(&self, assignment_id: u64) -> Result<Assignment>
Sourcepub async fn create_assignment(
&self,
params: CreateAssignmentParams,
) -> Result<Assignment>
pub async fn create_assignment( &self, params: CreateAssignmentParams, ) -> Result<Assignment>
Sourcepub fn get_sections(&self) -> PageStream<Section>
pub fn get_sections(&self) -> PageStream<Section>
Sourcepub async fn get_section(&self, section_id: u64) -> Result<Section>
pub async fn get_section(&self, section_id: u64) -> Result<Section>
Sourcepub fn get_enrollments(&self) -> PageStream<Enrollment>
pub fn get_enrollments(&self) -> PageStream<Enrollment>
Sourcepub fn get_users(&self) -> PageStream<User>
pub fn get_users(&self) -> PageStream<User>
Sourcepub async fn update(&self, params: UpdateCourseParams) -> Result<Course>
pub async fn update(&self, params: UpdateCourseParams) -> Result<Course>
Sourcepub async fn delete(&self) -> Result<Course>
pub async fn delete(&self) -> Result<Course>
Delete this course. Canvas returns the deleted course object.
§Canvas API
DELETE /api/v1/courses/:id
Sourcepub fn get_quizzes(&self) -> PageStream<Quiz>
pub fn get_quizzes(&self) -> PageStream<Quiz>
Sourcepub async fn create_quiz(&self, params: CreateQuizParams) -> Result<Quiz>
pub async fn create_quiz(&self, params: CreateQuizParams) -> Result<Quiz>
Sourcepub fn get_modules(&self) -> PageStream<Module>
pub fn get_modules(&self) -> PageStream<Module>
Sourcepub async fn get_module(&self, module_id: u64) -> Result<Module>
pub async fn get_module(&self, module_id: u64) -> Result<Module>
Sourcepub fn get_pages(&self) -> PageStream<Page>
pub fn get_pages(&self) -> PageStream<Page>
Sourcepub fn get_discussion_topics(&self) -> PageStream<DiscussionTopic>
pub fn get_discussion_topics(&self) -> PageStream<DiscussionTopic>
Sourcepub async fn get_discussion_topic(
&self,
topic_id: u64,
) -> Result<DiscussionTopic>
pub async fn get_discussion_topic( &self, topic_id: u64, ) -> Result<DiscussionTopic>
Sourcepub fn get_files(&self) -> PageStream<File>
pub fn get_files(&self) -> PageStream<File>
Sourcepub fn get_tabs(&self) -> PageStream<Tab>
pub fn get_tabs(&self) -> PageStream<Tab>
Sourcepub fn get_groups(&self) -> PageStream<Group>
pub fn get_groups(&self) -> PageStream<Group>
Sourcepub async fn upload_file(
&self,
request: UploadRequest,
data: Vec<u8>,
) -> Result<File>
pub async fn upload_file( &self, request: UploadRequest, data: Vec<u8>, ) -> Result<File>
Upload a file to this course.
Canvas uses a two-step upload: first POSTing metadata to obtain an upload URL, then POSTing the file as multipart form data to that URL.
§Canvas API
POST /api/v1/courses/:id/files
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Course
impl<'de> Deserialize<'de> for Course
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
Auto Trait Implementations§
impl Freeze for Course
impl !RefUnwindSafe for Course
impl Send for Course
impl Sync for Course
impl Unpin for Course
impl UnsafeUnpin for Course
impl !UnwindSafe for Course
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more