pub struct DocumentBuilder { /* private fields */ }Expand description
Builder for creating Codex documents.
Implementations§
Source§impl DocumentBuilder
impl DocumentBuilder
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Set the document description.
Sourcepub fn state(self, state: DocumentState) -> Self
pub fn state(self, state: DocumentState) -> Self
Set the document state.
Sourcepub fn hash_algorithm(self, algorithm: HashAlgorithm) -> Self
pub fn hash_algorithm(self, algorithm: HashAlgorithm) -> Self
Set the hash algorithm.
Sourcepub fn add_heading(self, level: u8, text: impl Into<String>) -> Self
pub fn add_heading(self, level: u8, text: impl Into<String>) -> Self
Add a heading block.
Sourcepub fn add_paragraph(self, text: impl Into<String>) -> Self
pub fn add_paragraph(self, text: impl Into<String>) -> Self
Add a paragraph block.
Sourcepub fn add_code_block(
self,
code: impl Into<String>,
language: Option<String>,
) -> Self
pub fn add_code_block( self, code: impl Into<String>, language: Option<String>, ) -> Self
Add a code block.
Sourcepub fn with_content(self, content: Content) -> Self
pub fn with_content(self, content: Content) -> Self
Set pre-built content, overriding any blocks added via add_block().
Sourcepub fn with_dublin_core(self, dublin_core: DublinCore) -> Self
pub fn with_dublin_core(self, dublin_core: DublinCore) -> Self
Set pre-built Dublin Core metadata, overriding title/creator/description/language.
Trait Implementations§
Source§impl Clone for DocumentBuilder
impl Clone for DocumentBuilder
Source§fn clone(&self) -> DocumentBuilder
fn clone(&self) -> DocumentBuilder
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 DocumentBuilder
impl Debug for DocumentBuilder
Auto Trait Implementations§
impl Freeze for DocumentBuilder
impl RefUnwindSafe for DocumentBuilder
impl Send for DocumentBuilder
impl Sync for DocumentBuilder
impl Unpin for DocumentBuilder
impl UnsafeUnpin for DocumentBuilder
impl UnwindSafe for DocumentBuilder
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