Skip to main content

LessonSource

Trait LessonSource 

Source
pub trait LessonSource:
    Send
    + Sync
    + Debug {
    // Required method
    fn notes<'a>(
        &'a self,
        scope: &'a LessonScope,
    ) -> BoxFuture<'a, Result<LessonNotes, LearningError>>;

    // Provided method
    fn adopt<'a>(
        &'a self,
        scope: &'a LessonScope,
        actor: &'a str,
    ) -> BoxFuture<'a, Result<usize, LearningError>> { ... }
}
Expand description

A source of approved lessons.

Required Methods§

Source

fn notes<'a>( &'a self, scope: &'a LessonScope, ) -> BoxFuture<'a, Result<LessonNotes, LearningError>>

The approved lessons scope may read.

Provided Methods§

Source

fn adopt<'a>( &'a self, scope: &'a LessonScope, actor: &'a str, ) -> BoxFuture<'a, Result<usize, LearningError>>

Before a run of scope’s user reads its lessons, when its host named where the user comes from: move the lessons kept under the user’s id without its source to the scoped id. Returns how many moved.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§