pub struct RootfileBuilder { /* private fields */ }Expand description
Rootfile builder for EPUB container
The RootfileBuilder is responsible for managing the rootfile paths in the EPUB container.
Each rootfile points to an OPF (Open Packaging Format) file that defines the structure
and content of an EPUB publication.
In EPUB 3.0, a single rootfile is typically used, but the structure supports multiple rootfiles for more complex publications.
§Notes
- Rootfile paths must be relative and cannot start with “../” or “/”
- At least one rootfile must be added before building the EPUB
Implementations§
Source§impl RootfileBuilder
impl RootfileBuilder
Sourcepub fn add(&mut self, rootfile: impl AsRef<str>) -> Result<&mut Self, EpubError>
pub fn add(&mut self, rootfile: impl AsRef<str>) -> Result<&mut Self, EpubError>
Add a rootfile path
Adds a new rootfile path to the builder. The rootfile points to the OPF file that will be created when building the EPUB.
§Parameters
rootfile: The relative path to the OPF file
§Return
Ok(&mut Self): Successfully added the rootfileErr(EpubError): Error if the path is invalid (starts with “/” or “../”)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RootfileBuilder
impl RefUnwindSafe for RootfileBuilder
impl Send for RootfileBuilder
impl Sync for RootfileBuilder
impl Unpin for RootfileBuilder
impl UnsafeUnpin for RootfileBuilder
impl UnwindSafe for RootfileBuilder
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