pub enum CourseInstanceOrExamId {
Instance(Uuid),
Exam(Uuid),
}
Expand description
Either a course instance or exam id.
Exercises can either be part of courses or exams. Many user-related actions need to differentiate
between two, so CourseInstanceOrExamId
helps when handling these separate scenarios.
Variants§
Implementations§
source§impl CourseInstanceOrExamId
impl CourseInstanceOrExamId
pub fn from_instance_and_exam_ids( course_instance_id: Option<Uuid>, exam_id: Option<Uuid> ) -> ModelResult<Self>
pub fn to_instance_and_exam_ids(&self) -> (Option<Uuid>, Option<Uuid>)
Trait Implementations§
source§impl Clone for CourseInstanceOrExamId
impl Clone for CourseInstanceOrExamId
source§fn clone(&self) -> CourseInstanceOrExamId
fn clone(&self) -> CourseInstanceOrExamId
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CourseInstanceOrExamId
impl Debug for CourseInstanceOrExamId
source§impl<'de> Deserialize<'de> for CourseInstanceOrExamId
impl<'de> Deserialize<'de> for CourseInstanceOrExamId
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
source§impl PartialEq for CourseInstanceOrExamId
impl PartialEq for CourseInstanceOrExamId
source§fn eq(&self, other: &CourseInstanceOrExamId) -> bool
fn eq(&self, other: &CourseInstanceOrExamId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for CourseInstanceOrExamId
impl Serialize for CourseInstanceOrExamId
source§impl TryFrom<UserExerciseState> for CourseInstanceOrExamId
impl TryFrom<UserExerciseState> for CourseInstanceOrExamId
§type Error = ModelError
type Error = ModelError
The type returned in the event of a conversion error.
impl Copy for CourseInstanceOrExamId
impl Eq for CourseInstanceOrExamId
impl StructuralEq for CourseInstanceOrExamId
impl StructuralPartialEq for CourseInstanceOrExamId
Auto Trait Implementations§
impl RefUnwindSafe for CourseInstanceOrExamId
impl Send for CourseInstanceOrExamId
impl Sync for CourseInstanceOrExamId
impl Unpin for CourseInstanceOrExamId
impl UnwindSafe for CourseInstanceOrExamId
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.