Crate laminarmq_io
source ·Expand description
laminarmq-io
An attempt to rewrite the laminarmq I/O layer
to accommodate bounded memory overhead during read/write ops.
§Usage
laminarmq-io is a library crate. In order to use it, add the following to your Cargo.toml
[dependencies]
laminarmq-io = { git = "https://github.com/arindas/laminarmq-io.git" }
§Overview
This crate provides the following I/O related traits:
| Trait | Type | Wrapper Implemented On |
|---|---|---|
AsyncRead | Read I/O | AsyncBufRead, AsyncRead (struct BufReader) |
AsyncBufRead | Read I/O | - |
StreamRead | Streaming Read I/O | AsyncRead (struct AsyncReadStreamRead,struct BufReader) |
AsyncAppend | Write I/O | AsyncAppend (struct BufAppender) |
StreamAppend | Streaming Write I/O | AsyncAppend (trait impl) |
AsyncTruncate | Write I/O | - |
AsyncRemove | Management | - |
AsyncClose | Management | - |
The “Wrapper Implemented on” column denotes on which underlying trait, the current trait has an impl with the help of a wrapper struct wrapping the mentioned trait. For example,
StreamReadis implemented by a wrapper structAsyncReadStreamReadwhich wraps anAsyncReadinstance.Some traits in this table also have direct impls on other trait types e.g:
impl<T> StreamAppend for T where T: AsyncAppend { /* ... */ }They are marked with (trait impl).
This library makes the following improvements over existing I/O primitives in laminarmq:
- Provides traits at individual operaton level i.e
Read/Appendlevel as opposed to a unifiedStoragetrait - All operations are exclusive with a
&mut selfreceiver to avoid internal locks - Supports both streaming read and streaming write operations
- Provides impls on both filessytem based APIs and cloud object storage APIs such as S3
§License
This repository is licensed under the same terms as laminarmq.
See LICENSE for more details.
Re-exports§
pub use prelude::*;