[−][src]Struct magic_ring_buffer::MagicRingBuffer
A magic ring buffer (also known as virtual ring buffer, VRB, or a mirrored ring buffer).
Methods
impl MagicRingBuffer
[src]
pub fn allocate_mirrored_and_not_swappable_from_dev_shm(
file_extension: &str,
buffer_size_not_page_aligned: usize
) -> Result<Self, MirroredMemoryMapCreationError>
[src]
file_extension: &str,
buffer_size_not_page_aligned: usize
) -> Result<Self, MirroredMemoryMapCreationError>
Creates a new instance.
pub fn recovery_if_using_persistent_memory(&self)
[src]
In a recovery scenario, we can potentially (a) re-read a message and (b) will lose all messages written but not committed between unread_offset
and writer_offset
.
pub fn write_some_data(
&self,
amount_we_want_to_write: usize,
writer: impl FnOnce(&mut [u8])
)
[src]
&self,
amount_we_want_to_write: usize,
writer: impl FnOnce(&mut [u8])
)
The logic in writer
must not panic; if it does, then the entire queue is effectively corrupt and irrecoverable.
pub fn single_reader_read_some_data<E, Reader: FnOnce(&mut [u8]) -> (usize, Result<(), E>)>(
&self,
reader: Reader
) -> Result<bool, E>
[src]
&self,
reader: Reader
) -> Result<bool, E>
Read data, assuming a single reader is active.
This is NOT enforced.
Returns true if there is more data to read.
Trait Implementations
Auto Trait Implementations
impl !Send for MagicRingBuffer
impl !Sync for MagicRingBuffer
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,