pub struct ContentSection { /* private fields */ }
Expand description
A content section names a list of ContentItem
s.
Implementations§
Source§impl ContentSection
impl ContentSection
pub fn new<S, I>(heading: S, items: Vec<I>) -> Self
pub fn item_count(&self) -> usize
pub fn with_heading<S>(self, heading: S) -> Self
pub fn heading(&self) -> &String
pub fn with_items<I>(self, items: Vec<I>) -> Selfwhere
I: Into<ContentItem>,
pub fn with_item<I>(self, item: I) -> Selfwhere
I: Into<ContentItem>,
pub fn with_source_file(self, module_path: PathBuf) -> Self
pub fn with_source_module(self, module: Identifier) -> Self
pub fn with_include(self, include_file_path: PathBuf) -> Self
pub fn with_sub_section(self, sub_section: ContentSection) -> Self
pub fn items(&self) -> &Vec<ContentItem>
Trait Implementations§
Source§impl Clone for ContentSection
impl Clone for ContentSection
Source§fn clone(&self) -> ContentSection
fn clone(&self) -> ContentSection
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ContentSection
impl Debug for ContentSection
Source§impl Default for ContentSection
impl Default for ContentSection
Source§fn default() -> ContentSection
fn default() -> ContentSection
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ContentSection
impl<'de> Deserialize<'de> for ContentSection
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
Source§impl From<ContentSection> for ContentItem
impl From<ContentSection> for ContentItem
Source§fn from(sub_section: ContentSection) -> Self
fn from(sub_section: ContentSection) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ContentSection
impl RefUnwindSafe for ContentSection
impl Send for ContentSection
impl Sync for ContentSection
impl Unpin for ContentSection
impl UnwindSafe for ContentSection
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