Skip to main content

CatalogBuilder

Struct CatalogBuilder 

Source
pub struct CatalogBuilder { /* private fields */ }
Expand description

Catalog builder for EPUB navigation

The CatalogBuilder is responsible for building the navigation document (TOC) of an EPUB publication. The navigation document provides a hierarchical table of contents that allows readers to navigate through the publication’s content.

The navigation document is a special XHTML document that uses the EPUB Navigation Document specification.

Implementations§

Source§

impl CatalogBuilder

Source

pub fn set_title(&mut self, title: impl Into<String>) -> &mut Self

Set the catalog title

Sets the title that will be displayed at the top of the navigation document.

§Parameters
  • title: The title to set
§Return
  • &mut Self: Returns a mutable reference to itself for method chaining
Source

pub fn add(&mut self, item: NavPoint) -> &mut Self

Add a navigation point

Appends a new navigation point to the catalog. Navigation points can be nested by using the append_child method on NavPoint.

§Parameters
  • item: The navigation point to add
§Return
  • &mut Self: Returns a mutable reference to itself for method chaining
Source

pub fn clear(&mut self) -> &mut Self

Clear all catalog items

Removes the title and all navigation points from the builder.

Trait Implementations§

Source§

impl Debug for CatalogBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.