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
leakedpointer to RwBufferInner. - RwBuffer
Inner - 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§
Traits§
- Local
Async Clone - An interface of the
async_clonefor async. - Local
Async Drop - An interface of the
async_dropfor async. - TryClone
- A local try_clone trait.
Functions§
- async_
drop - Use this function to drop RBuffer and WBuffer obtained via
async_*.