Expand description
Input structures that can be fed into an Engine.
The engine itself is generic in the Input trait declared here.
There are a couple of different built-in implementations, each
suitable for a different scenario. Consult the module-level
documentation of each type to determine which to use. Here’s a quick
cheat-sheet:
| Input scenario | Type to use |
|---|---|
| memory based | BorrowedBytes |
| memory based, take ownership | OwnedBytes |
| file based | MmapInput |
Read based | BufferedInput |
Re-exports§
pub use borrowed::BorrowedBytes;pub use buffered::BufferedInput;pub use mmap::MmapInput;pub use owned::OwnedBytes;
Modules§
- borrowed
- Borrows a slice of bytes of the input document.
- buffered
- Acquires a
Readinstance and reads it in on-demand in a buffer. All of the bytes read are kept in memory. - error
- Error types for the
inputmodule. - mmap
- Uses
Mmapto map a file into memory with kernel support. - owned
- Takes ownership of bytes of the input document.
Constants§
- MAX_
BLOCK_ SIZE - Global padding guarantee for all
Inputimplementations. Iterating over blocks of at most this size is guaranteed to produce only full blocks.
Traits§
- Input
- UTF-8 encoded bytes representing a JSON document that support block-by-block iteration and basic seeking procedures.
- Input
Block - A block of bytes of size
Nreturned fromInputBlockIterator. - Input
Block Iterator - An iterator over blocks of input of size
N. Implementations MUST guarantee that the blocks returned fromnextare exactly of sizeN.