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§
Sourcefn notes<'a>(
&'a self,
scope: &'a LessonScope,
) -> BoxFuture<'a, Result<LessonNotes, LearningError>>
fn notes<'a>( &'a self, scope: &'a LessonScope, ) -> BoxFuture<'a, Result<LessonNotes, LearningError>>
The approved lessons scope may read.
Provided Methods§
Sourcefn adopt<'a>(
&'a self,
scope: &'a LessonScope,
actor: &'a str,
) -> BoxFuture<'a, Result<usize, LearningError>>
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".