pub trait Bundle: IoProvider {
    // Required method
    fn all_files(
        &mut self,
        status: &mut dyn StatusBackend
    ) -> Result<Vec<String>>;

    // Provided method
    fn get_digest(
        &mut self,
        status: &mut dyn StatusBackend
    ) -> Result<DigestData> { ... }
}
Expand description

A trait for bundles of Tectonic support files.

A “bundle” is an IoProvider with a few special properties. Bundles are read-only, and their contents can be enumerated In principle a bundle is completely defined by its file contents, which can be summarized by a cryptographic digest, obtainable using the Self::get_digest method: two bundles with the same digest should contain exactly the same set of files, and if any aspect of a bundle’s file contents change, so should its digest. Finally, it is generally expected that a bundle will contain a large number of TeX support files, and that you can generate one or more TeX format files using only the files contained in a bundle.

Required Methods§

source

fn all_files(&mut self, status: &mut dyn StatusBackend) -> Result<Vec<String>>

Enumerate the files in this bundle.

This interface is intended to be used for diagnostics, not by anything during actual execution of an engine. This should include meta-files such as the SHA256SUM file. The ordering of the returned filenames is unspecified.

To ease implementation, the filenames are returned in one big vector of owned strings. For a large bundle, the memory consumed by this operation might be fairly substantial (although we are talking megabytes, not gigabytes).

Provided Methods§

source

fn get_digest(&mut self, status: &mut dyn StatusBackend) -> Result<DigestData>

Get a cryptographic digest summarizing this bundle’s contents.

The digest summarizes the exact contents of every file in the bundle. It is computed from the sorted names and SHA256 digests of the component files as implemented in the TeXLive bundle builder.

The default implementation gets the digest from a file named SHA256SUM, which is expected to contain the digest in hex-encoded format.

Implementations on Foreign Types§

source§

impl<B: Bundle + ?Sized> Bundle for Box<B>

source§

fn get_digest(&mut self, status: &mut dyn StatusBackend) -> Result<DigestData>

source§

fn all_files(&mut self, status: &mut dyn StatusBackend) -> Result<Vec<String>>

Implementors§