pub struct DocumentBuilder { /* private fields */ }Implementations§
Source§impl DocumentBuilder
impl DocumentBuilder
Sourcepub fn add(
&mut self,
target: impl AsRef<str>,
content: ContentBuilder,
) -> &mut Self
pub fn add( &mut self, target: impl AsRef<str>, content: ContentBuilder, ) -> &mut Self
Add a content document
Appends a new content document to be processed during EPUB building.
§Parameters
target: The target path within the EPUB container where the content will be placedcontent: The content builder containing the document content
§Return
&mut Self: Returns a mutable reference to itself for method chaining
Sourcepub fn clear(&mut self) -> &mut Self
pub fn clear(&mut self) -> &mut Self
Clear all documents
Removes all content documents from the builder.
Sourcepub fn make(
&mut self,
temp_dir: PathBuf,
rootfile: impl AsRef<str>,
) -> Result<Vec<ManifestItem>, EpubError>
pub fn make( &mut self, temp_dir: PathBuf, rootfile: impl AsRef<str>, ) -> Result<Vec<ManifestItem>, EpubError>
Generate manifest items from content documents
Processes all content documents and generates the corresponding manifest items. Each content document may generate multiple manifest entries - one for the main document and additional entries for any resources (images, fonts, etc.) it contains.
§Parameters
temp_dir: The temporary directory path used during the EPUB build processrootfile: The path to the OPF file (package document)
§Return
Ok(Vec<ManifestItem>): List of manifest items generated from the content documentsErr(EpubError): Error if document generation or file processing fails
Trait Implementations§
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