pub struct ChapterBuilder {
pub number: i32,
pub name: String,
pub opens_at: Option<DateTime<Utc>>,
pub deadline: Option<DateTime<Utc>>,
pub pages: Vec<PageBuilder>,
pub chapter_id: Option<Uuid>,
pub front_page_id: Option<Uuid>,
pub front_page_content: Option<Vec<GutenbergBlock>>,
}
Expand description
Builder for course chapters with pages, opening times, and deadlines.
Fields§
§number: i32
§name: String
§opens_at: Option<DateTime<Utc>>
§deadline: Option<DateTime<Utc>>
§pages: Vec<PageBuilder>
§chapter_id: Option<Uuid>
§front_page_id: Option<Uuid>
§front_page_content: Option<Vec<GutenbergBlock>>
Implementations§
Source§impl ChapterBuilder
impl ChapterBuilder
pub fn new(number: i32, name: impl Into<String>) -> Self
pub fn opens(self, t: DateTime<Utc>) -> Self
pub fn deadline(self, t: DateTime<Utc>) -> Self
pub fn chapter_id(self, ch_id: Uuid) -> Self
pub fn front_page_id(self, front_id: Uuid) -> Self
pub fn fixed_ids(self, chapter_id: Uuid, front_page_id: Uuid) -> Self
pub fn page(self, p: PageBuilder) -> Self
pub fn pages<I: IntoIterator<Item = PageBuilder>>(self, it: I) -> Self
Sourcepub fn front_page_content(self, content: Vec<GutenbergBlock>) -> Self
pub fn front_page_content(self, content: Vec<GutenbergBlock>) -> Self
Set custom content for the chapter front page. If not set, default content will be used.
pub(crate) async fn seed( self, cx: &mut SeedContext<'_>, course_id: Uuid, module_id: Uuid, ) -> Result<()>
Trait Implementations§
Source§impl Clone for ChapterBuilder
impl Clone for ChapterBuilder
Source§fn clone(&self) -> ChapterBuilder
fn clone(&self) -> ChapterBuilder
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for ChapterBuilder
impl RefUnwindSafe for ChapterBuilder
impl Send for ChapterBuilder
impl Sync for ChapterBuilder
impl Unpin for ChapterBuilder
impl UnwindSafe for ChapterBuilder
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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