Skip to content

arindas/laminarmq-io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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] R I/O [AsyncBufRead], [AsyncRead]
(struct [BufferedReader])
[AsyncBufRead] R I/O -
[StreamRead] Streaming R I/O [AsyncRead] (struct [AsyncReadStreamRead],
struct [BufferedReader])
[AsyncAppend] W I/O [AsyncAppend] (struct [BufferedAppender])
[StreamAppend] Streaming W I/O [AsyncAppend] (trait impl)
[AsyncTruncate] W 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, [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.