Crate tmpfile

source ·
Expand description

Representation of a temporary file that can be persisted.

This is intended to be used in an application that needs to receive a file to persistent storage, but doesn’t know its final target file name until it has received the entire file (such as if the file’s name should be its content’s hash).

§Minimum size

In some cases an application may not want to store small files in its filesystem based data store. For this purpose, the TmpFile can be set up to have a minimum file size. If a TmpFile does not reach this size before being persisted, a buffer of the file’s contents will be returned instead of a file name of the persisted file.

The TmpFile::with_minsize() factory method can be used to use this feature.

Structs§

Enums§

  • Temporary file contents container returned after successful persist.

Traits§

  • Used to inspect content as it is being fed to the temporary file.