Struct trane::data::CourseManifestBuilder
source · pub struct CourseManifestBuilder { /* private fields */ }Expand description
Builder for CourseManifest.
Implementations§
source§impl CourseManifestBuilder
impl CourseManifestBuilder
sourcepub fn id<VALUE: Into<Ustr>>(&mut self, value: VALUE) -> &mut Self
pub fn id<VALUE: Into<Ustr>>(&mut self, value: VALUE) -> &mut Self
The ID assigned to this course.
For example, music::instrument::guitar::basic_jazz_chords.
sourcepub fn name(&mut self, value: String) -> &mut Self
pub fn name(&mut self, value: String) -> &mut Self
The name of the course to be presented to the user.
For example, “Basic Jazz Chords on Guitar”.
sourcepub fn dependencies(&mut self, value: Vec<Ustr>) -> &mut Self
pub fn dependencies(&mut self, value: Vec<Ustr>) -> &mut Self
The IDs of all dependencies of this course.
sourcepub fn description(&mut self, value: Option<String>) -> &mut Self
pub fn description(&mut self, value: Option<String>) -> &mut Self
An optional description of the course.
An optional list of the course’s authors.
sourcepub fn metadata(
&mut self,
value: Option<BTreeMap<String, Vec<String>>>
) -> &mut Self
pub fn metadata( &mut self, value: Option<BTreeMap<String, Vec<String>>> ) -> &mut Self
be attached to a course named “Basic Jazz Chords on Guitar”.
The purpose of this metadata is to allow students to focus on more specific material during a study session which does not belong to a single lesson or course. For example, a student might want to only focus on guitar scales or ear training.
sourcepub fn course_material(&mut self, value: Option<BasicAsset>) -> &mut Self
pub fn course_material(&mut self, value: Option<BasicAsset>) -> &mut Self
An optional asset, which presents the material covered in the course.
sourcepub fn course_instructions(&mut self, value: Option<BasicAsset>) -> &mut Self
pub fn course_instructions(&mut self, value: Option<BasicAsset>) -> &mut Self
An optional asset, which presents instructions common to all exercises in the course.
sourcepub fn generator_config(&mut self, value: Option<CourseGenerator>) -> &mut Self
pub fn generator_config(&mut self, value: Option<CourseGenerator>) -> &mut Self
An optional configuration to generate material for this course. Generated courses allow easier creation of courses for specific purposes without requiring the manual creation of all the files a normal course would need.
sourcepub fn build(&self) -> Result<CourseManifest, CourseManifestBuilderError>
pub fn build(&self) -> Result<CourseManifest, CourseManifestBuilderError>
Trait Implementations§
source§impl Clone for CourseManifestBuilder
impl Clone for CourseManifestBuilder
source§fn clone(&self) -> CourseManifestBuilder
fn clone(&self) -> CourseManifestBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl RefUnwindSafe for CourseManifestBuilder
impl Send for CourseManifestBuilder
impl Sync for CourseManifestBuilder
impl Unpin for CourseManifestBuilder
impl UnwindSafe for CourseManifestBuilder
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.