pub struct CourseStructure {
pub id: Uuid,
pub pages: Vec<StructurePage>,
pub modules: Vec<StructureModule>,
}Expand description
The course tree as agents read and edit it. Children arrays are in display order.
Fields§
§id: Uuid§pages: Vec<StructurePage>Pages outside chapters; the course front page (/) is always first.
modules: Vec<StructureModule>The default module is always first.
Implementations§
Source§impl CourseStructure
impl CourseStructure
Sourcepub fn modules(&self) -> impl Iterator<Item = &StructureModule>
pub fn modules(&self) -> impl Iterator<Item = &StructureModule>
The modules in order.
Sourcepub fn chapters(&self) -> impl Iterator<Item = &StructureChapter>
pub fn chapters(&self) -> impl Iterator<Item = &StructureChapter>
Every chapter, in course order.
Sourcepub(crate) fn chapters_mut(
&mut self,
) -> impl Iterator<Item = &mut StructureChapter>
pub(crate) fn chapters_mut( &mut self, ) -> impl Iterator<Item = &mut StructureChapter>
Self::chapters for editing.
Sourcepub fn pages(
&self,
) -> impl Iterator<Item = (Option<&StructureChapter>, &StructurePage)>
pub fn pages( &self, ) -> impl Iterator<Item = (Option<&StructureChapter>, &StructurePage)>
Every page with the chapter it belongs to.
Sourcepub(crate) fn pages_mut(&mut self) -> impl Iterator<Item = &mut StructurePage>
pub(crate) fn pages_mut(&mut self) -> impl Iterator<Item = &mut StructurePage>
Every page, top-level ones first.
Sourcepub fn page(&self, page_id: Uuid) -> Option<&StructurePage>
pub fn page(&self, page_id: Uuid) -> Option<&StructurePage>
The page page_id, wherever it is.
Sourcepub(crate) fn page_mut(&mut self, page_id: Uuid) -> Option<&mut StructurePage>
pub(crate) fn page_mut(&mut self, page_id: Uuid) -> Option<&mut StructurePage>
Self::page for editing.
Sourcepub fn chapter_of_page(&self, page_id: Uuid) -> Option<&StructureChapter>
pub fn chapter_of_page(&self, page_id: Uuid) -> Option<&StructureChapter>
The chapter holding the page; None for a page outside chapters.
Sourcepub fn is_chapter_front_page(&self, page_id: Uuid) -> bool
pub fn is_chapter_front_page(&self, page_id: Uuid) -> bool
Whether the page is the first of its chapter.
Sourcepub fn module(&self, id: Uuid) -> Option<&StructureModule>
pub fn module(&self, id: Uuid) -> Option<&StructureModule>
The module id.
Sourcepub(crate) fn module_mut(&mut self, id: Uuid) -> Option<&mut StructureModule>
pub(crate) fn module_mut(&mut self, id: Uuid) -> Option<&mut StructureModule>
Self::module for editing.
Sourcepub fn chapter(&self, id: Uuid) -> Option<&StructureChapter>
pub fn chapter(&self, id: Uuid) -> Option<&StructureChapter>
The chapter id.
Sourcepub(crate) fn chapter_mut(&mut self, id: Uuid) -> Option<&mut StructureChapter>
pub(crate) fn chapter_mut(&mut self, id: Uuid) -> Option<&mut StructureChapter>
Self::chapter for editing.
Trait Implementations§
Source§impl Clone for CourseStructure
impl Clone for CourseStructure
Source§fn clone(&self) -> CourseStructure
fn clone(&self) -> CourseStructure
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CourseStructure
impl Debug for CourseStructure
Source§impl PartialEq for CourseStructure
impl PartialEq for CourseStructure
Source§impl Serialize for CourseStructure
impl Serialize for CourseStructure
impl StructuralPartialEq for CourseStructure
Auto Trait Implementations§
impl Freeze for CourseStructure
impl RefUnwindSafe for CourseStructure
impl Send for CourseStructure
impl Sync for CourseStructure
impl Unpin for CourseStructure
impl UnsafeUnpin for CourseStructure
impl UnwindSafe for CourseStructure
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Decompress response bodies. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more