pub struct NewCoursePage<'a> {
pub content: Vec<GutenbergBlock>,
pub course_id: Uuid,
pub order_number: i32,
pub title: &'a str,
pub hidden: bool,
pub url_path: &'a str,
}
Fields§
§content: Vec<GutenbergBlock>
§course_id: Uuid
§order_number: i32
§title: &'a str
§url_path: &'a str
Implementations§
Source§impl<'a> NewCoursePage<'a>
impl<'a> NewCoursePage<'a>
Sourcepub fn new(
course_id: Uuid,
order_number: i32,
url_path: &'a str,
title: &'a str,
) -> Self
pub fn new( course_id: Uuid, order_number: i32, url_path: &'a str, title: &'a str, ) -> Self
Creates NewCoursePage
with provided values that is public by default.
Sourcepub fn followed_by(&self, url_path: &'a str, title: &'a str) -> Self
pub fn followed_by(&self, url_path: &'a str, title: &'a str) -> Self
Creates a new NewCoursePage
for the same course as this one and increments the page number.
Sourcepub fn set_content(self, content: Vec<GutenbergBlock>) -> Self
pub fn set_content(self, content: Vec<GutenbergBlock>) -> Self
Sets the content of this page.
Sets the hidden status of this page.
Trait Implementations§
Source§impl<'a> Debug for NewCoursePage<'a>
impl<'a> Debug for NewCoursePage<'a>
Source§impl<'de: 'a, 'a> Deserialize<'de> for NewCoursePage<'a>
impl<'de: 'a, 'a> Deserialize<'de> for NewCoursePage<'a>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<'a> Freeze for NewCoursePage<'a>
impl<'a> RefUnwindSafe for NewCoursePage<'a>
impl<'a> Send for NewCoursePage<'a>
impl<'a> Sync for NewCoursePage<'a>
impl<'a> Unpin for NewCoursePage<'a>
impl<'a> UnwindSafe for NewCoursePage<'a>
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> 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