Struct bookfile::BookWriter[][src]

pub struct BookWriter<W> { /* fields omitted */ }
Expand description

A tool for writing a Book.

A BookWriter creates a new Book.

To write a chapter, call new_chapter().

When the book is complete, call close() to flush any remaining bytes and write out the table of contents.

Implementations

Create a new BookWriter.

user_magic is a number stored in the file for later identification. It can contain any value the user wants, and can be used to disambiguate different kinds of files.

Create a new ChapterWriter.

The chapter id can be any value the user wants, and can be used to later locate a chapter. It may be any type that implements Into<ChapterId>.

Finish writing the Book file.

On success, this returns the original writer stream. It is normal to discard it, except in unit tests.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.