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.
§Features:
std- when enabled uses STD otherwise uses COREenable_async- when enabled - enables async codeclone_wait_indef- when enabled does not panic in clone() on timeout, but rather waits until operation completes
[features]
default = ["std", "default_flags"]
default_flags = ["clone_wait_indef", "enable_async"]Re-exports§
pub use self::sbr_async::async_drop;pub use self::sbr_async::LocalAsyncClone;pub use self::sbr_async::LocalAsyncDrop;
Modules§
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§
- TryClone
- A local try_clone trait.