1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//! # Canvas API Integration Library
//!
//! This Rust library provides functionalities for interacting with the Canvas Learning Management System (LMS) API.
//! It simplifies tasks like retrieving course information, managing student data, and processing assignments and submissions.
//! The library utilizes the `reqwest` crate for HTTP requests and incorporates concurrency control for efficient request handling.
//!
//! ## Core Features
//!
//! - **Authentication and Configuration:** Handles Canvas API credentials, supporting both file-based and system keyring storage.
//! - **Course Management:** Facilitates access to course information, enabling users to interact with course details.
//! - **Student Management:** Provides functionalities to manage student data within courses.
//! - **Assignments and Submissions Handling:** Allows for retrieval and updating of assignment information and student submissions.
//!
//! ## Usage
//!
//! To use this library, add it as a dependency in your `Cargo.toml`. Use the provided structures and functions
//! to interact with the Canvas API as per your application's requirements.
//!
//! ```toml
//! [dependencies]
//! canvas_lms_connector = "0.1"
//! ```
//!
//! After adding the library as a dependency, you can use its features in your Rust application.
//!
//! The primary functions are `fetch_courses_with_credentials` and `fetch_single_course_with_credentials`.
//! - `fetch_courses_with_credentials` retrieves a list of courses using provided Canvas API credentials.
//! - `fetch_single_course_with_credentials` fetches details of a specific course using the given credentials.
//!
//! Both functions require a reference to `CanvasCredentials`, which contain the necessary API URL and token.
//! They return results encapsulated in `CanvasResultCourses` or `CanvasResultSingleCourse` enums,
//! representing either successful data retrieval or an error (connection or credential issues).
//!
//! ### Examples
//!
//! Fetching a list of courses:
//! ```rust
//! let canvas_credentials = CanvasCredentials { /* ... */ };
//! match Canvas::fetch_courses_with_credentials(&canvas_credentials) {
//! CanvasResultCourses::Ok(courses) => println!("Courses: {:?}", courses),
//! CanvasResultCourses::ErrConnection(err) => eprintln!("Connection error: {}", err),
//! CanvasResultCourses::ErrCredentials(err) => eprintln!("Credentials error: {}", err),
//! }
//! ```
//!
//! Fetching a specific course by ID:
//! ```rust
//! let canvas_credentials = CanvasCredentials { /* ... */ };
//! let course_id = 123;
//! match Canvas::fetch_single_course_with_credentials(&canvas_credentials, course_id) {
//! CanvasResultSingleCourse::Ok(course) => println!("Course: {:?}", course),
//! CanvasResultSingleCourse::ErrConnection(err) => eprintln!("Connection error: {}", err),
//! CanvasResultSingleCourse::ErrCredentials(err) => eprintln!("Credentials error: {}", err),
//! }
//! ```
// Manages HTTP connections and requests to the Canvas API.
// Handles the storage and retrieval of Canvas API credentials.
// Contains functionalities related to Canvas courses.
// Deals with operations related to students in Canvas courses.
// Manages assignments within Canvas courses.
// Handles submissions for assignments in Canvas.
// Exports key structures for external use.
pub use CanvasCredentials;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;