pub(crate) trait InCourseState: ContentEntity {
// Required methods
fn find_in(state: &CourseState, id: Uuid) -> Option<&Self>;
fn put_in(&self, state: &mut CourseState);
fn remove_from(state: &mut CourseState, id: Uuid);
// Provided method
fn is_in(state: &CourseState, id: Uuid) -> bool { ... }
}Expand description
How a CourseState holds one kind of content entity.
Required Methods§
Sourcefn find_in(state: &CourseState, id: Uuid) -> Option<&Self>
fn find_in(state: &CourseState, id: Uuid) -> Option<&Self>
The entity in state. Always None for pages, which states hold as PageRecords.
Sourcefn put_in(&self, state: &mut CourseState)
fn put_in(&self, state: &mut CourseState)
Adds the entity to state, or replaces it there.
Sourcefn remove_from(state: &mut CourseState, id: Uuid)
fn remove_from(state: &mut CourseState, id: Uuid)
Removes the entity from state; course settings stay, since a course always has them.
Provided Methods§
fn is_in(state: &CourseState, id: Uuid) -> bool
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.