pub struct Class<'a> { /* private fields */ }
Expand description
Parser for raw class data.
Implementations§
Source§impl Class<'_>
impl Class<'_>
Sourcepub fn is_open(&self) -> Result<bool, ParseError>
pub fn is_open(&self) -> Result<bool, ParseError>
Get if the class is open or closed.
Sourcepub fn class_type(&self) -> Result<ClassType, ParseError>
pub fn class_type(&self) -> Result<ClassType, ParseError>
Get the type of class.
For instance, this function will return Lecture
, Seminar
,
Lab
, Recitation
.
Sourcepub fn class_id(&self) -> Result<u32, ParseError>
pub fn class_id(&self) -> Result<u32, ParseError>
Get id of this class.
For instance, if the class says Class Nbr 23229
, this function
will return 23229
.
Sourcepub fn section(&self) -> Result<&str, ParseError>
pub fn section(&self) -> Result<&str, ParseError>
Get the section of this class.
For instance, if the class says Section A5
, this function will
return A5
.
Sourcepub fn days_of_week(
&self,
) -> Result<Option<Vec<Result<DayOfWeek, ParseError>>>, ParseError>
pub fn days_of_week( &self, ) -> Result<Option<Vec<Result<DayOfWeek, ParseError>>>, ParseError>
Get the days of week this class is in action.
Sourcepub fn start_time(&self) -> Result<Option<NaiveTime>, ParseError>
pub fn start_time(&self) -> Result<Option<NaiveTime>, ParseError>
Get the start time of this class.
Sourcepub fn end_time(&self) -> Result<Option<NaiveTime>, ParseError>
pub fn end_time(&self) -> Result<Option<NaiveTime>, ParseError>
Get the end time of this class.
Sourcepub fn room(&self) -> Result<&str, ParseError>
pub fn room(&self) -> Result<&str, ParseError>
Get the room and room number of this class.
For instance, if the class says Nsc 215
, this function will
return Nsc 215
.
Sourcepub fn instructor(&self) -> Result<&str, ParseError>
pub fn instructor(&self) -> Result<&str, ParseError>
Get the name of the instructor.
Note that sometimes the instructor doesn’t exist and is labeled as
To be Announced
. In that case, the function will error.
Sourcepub fn open_seats(&self) -> Result<Option<u32>, ParseError>
pub fn open_seats(&self) -> Result<Option<u32>, ParseError>
Get the open seats for this class.
Note that if the class is closed this function will error.
Sourcepub fn total_seats(&self) -> Result<Option<u32>, ParseError>
pub fn total_seats(&self) -> Result<Option<u32>, ParseError>
Get the total seats for this class.
Note that if the class is closed this function will error.