Crate shared_buffer_rs

Crate shared_buffer_rs 

Source
Expand description

A small crate which implements a thread safe implementation to allocate the buffer of some size, borrow as muable in current context or thread and borrow as many read only references as needed which are Send+Sync.

It acts like Arc but embeds the RefCell functionality without any issues with Send and Sync.

The main purpose it to have a lock free, lightweight buffer I/O for writing in one side and broadcast to multiple tasks i.e threads and async task making sure that it can not be modifyied.

Structs§

RBuffer
A read only buffer. This instance is Send and Sync as it does not provide any write access.
RwBuffer
A base instance which holds the leaked pointer to RwBufferInner.
RwBufferInner
RwBuffers
An instance which controls the allocation of the new buffers or reusage of already created and free instances. This instance is not thread safe. The external mutex should be used.
WBuffer
A Write and Read buffer. An exclusive instance which can not be copied or clonned. Once writing is complete, the instance can be dropped or downgraded to Read-only instance. This instance is NOT Send and Sync.

Enums§

RwBufferError

Traits§

LocalAsyncClone
An interface of the async_clone for async.
LocalAsyncDrop
An interface of the async_drop for async.
TryClone
A local try_clone trait.

Functions§

async_drop
Use this function to drop RBuffer and WBuffer obtained via async_*.

Type Aliases§

RwBufferRes