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:

TraitTypeWrapper Implemented On
AsyncReadR I/OAsyncBufRead, AsyncRead
(struct BufferedReader)
AsyncBufReadR I/O-
StreamReadStreaming R I/OAsyncRead (struct AsyncReadStreamRead,
struct BufferedReader)
AsyncAppendW I/OAsyncAppend (struct BufferedAppender)
StreamAppendStreaming W I/OAsyncAppend (trait impl)
AsyncTruncateW I/O-
AsyncRemoveManagement-
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, StreamRead is implemented by a wrapper struct AsyncReadStreamRead which wraps an AsyncRead instance.

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 / Append level as opposed to a unified Storage trait
  • All operations are exclusive with a &mut self receiver 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§

Modules§