Skip to main content

InCourseState

Trait InCourseState 

Source
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§

Source

fn find_in(state: &CourseState, id: Uuid) -> Option<&Self>

The entity in state. Always None for pages, which states hold as PageRecords.

Source

fn put_in(&self, state: &mut CourseState)

Adds the entity to state, or replaces it there.

Source

fn remove_from(state: &mut CourseState, id: Uuid)

Removes the entity from state; course settings stay, since a course always has them.

Provided Methods§

Source

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.

Implementors§