Expand description
§Disk-Based Single-Writer, Multiple-Reader In-Process File Sharing
Functionality for single-writer, multiple-reader file operations where multiple concurrent readers need to read from a file that is currently being written by the same process. The intended use case is the parallel processing of byte streams with minimum (process) memory requirements, e.g. in web services moving around large files.
Normally, reading a file while it is written results in the read stream ending prematurely as EOF; the purpose of this crate is to prevent exactly that.
Any file type can be used as a backing as long as it implements the crate’s SharedFileType
trait, which in turn requires AsyncWrite
and AsyncRead
.
§Crate Features
async-tempfile
: Enables theSharedTemporaryFile
type via the async-tempfile crate. Since this is how this crate was initially meant to be used, this feature is enabled by default.
Modules§
- prelude
- Prelude for commonly used types and traits.
Structs§
- Shared
File - A file with shared read/write access for in-process file sharing.
- Shared
File Reader - A reader for the shared temporary file.
- Shared
File Writer - A writer for the shared temporary file.
Enums§
- File
Size - The file size of the file to read.
Traits§
- Async
NewFile - Trait for types that can be newly constructed asynchronously.
- File
Path - Trait for types that can synchronously determine the file path.
- NewFile
- Trait for types that can be newly constructed asynchronously.
- Shared
File Type - Trait for types used as a file storage backend.
Type Aliases§
- Shared
Temporary File async-tempfile
- A type alias for a
SharedFile
wrapping aTempFile
. - Shared
Temporary File Reader async-tempfile
- A type alias for a
SharedFileReader
wrapping aTempFile
. - Shared
Temporary File Writer async-tempfile
- A type alias for a
SharedFileWriter
wrapping aTempFile
.