pub struct IClass {
pub user_session: Option<UserSessionInfo>,
/* private fields */
}Expand description
The iClass struct.
Fields§
§user_session: Option<UserSessionInfo>User session information.
Implementations§
Source§impl IClass
impl IClass
Sourcepub async fn check_in_by_uuid(
&self,
schedule_uuid: &str,
timestamp: u128,
) -> Result<CheckInResult, IClassError>
pub async fn check_in_by_uuid( &self, schedule_uuid: &str, timestamp: u128, ) -> Result<CheckInResult, IClassError>
Checks in the schedule with given uuid. This is equivalent to scanning the QR code on the smart device outside the classroom.
§Errors
See IClassError.
§Panics
This function will panic if system time is before [UNIX_EPOCH].
Sourcepub async fn check_in_by_id(
&self,
schedule_id: &str,
timestamp: u128,
) -> Result<CheckInResult, IClassError>
pub async fn check_in_by_id( &self, schedule_id: &str, timestamp: u128, ) -> Result<CheckInResult, IClassError>
Checks in the schedule with given id. This is equivalent to scanning the QR code on the computer inside the classroom.
§Errors
See IClassError.
§Panics
This function will panic if system time is before [UNIX_EPOCH].
Source§impl IClass
impl IClass
Source§impl IClass
impl IClass
Sourcepub async fn query_semester(&self) -> Result<Vec<Semester>, IClassError>
pub async fn query_semester(&self) -> Result<Vec<Semester>, IClassError>
Sourcepub async fn query_courses(&self) -> Result<Vec<Course>, IClassError>
pub async fn query_courses(&self) -> Result<Vec<Course>, IClassError>
Sourcepub async fn query_daily_schedule(
&self,
date: &NaiveDate,
) -> Result<Vec<Schedule>, IClassError>
pub async fn query_daily_schedule( &self, date: &NaiveDate, ) -> Result<Vec<Schedule>, IClassError>
Queries daily schedule.
§Arguments
date- A date string in “YYYYMMDD” format within the week to query, like “20251013”.
§Errors
See IClassError.
Sourcepub async fn query_weekly_schedule(
&self,
date: &NaiveDate,
) -> Result<Vec<DailySchedule>, IClassError>
pub async fn query_weekly_schedule( &self, date: &NaiveDate, ) -> Result<Vec<DailySchedule>, IClassError>
Queries weekly schedule.
§Arguments
date- A date string in “YYYYMMDD” format within the week to query, like “20251013”.
§Errors
See IClassError.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IClass
impl !RefUnwindSafe for IClass
impl Send for IClass
impl Sync for IClass
impl Unpin for IClass
impl !UnwindSafe for IClass
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more