pub struct Producer<T> { /* fields omitted */ }
Producer part of ring buffer.
Returns capacity of the ring buffer.
Checks if the ring buffer is empty.
Checks if the ring buffer is full.
Pushes element into ring buffer.
On error returns pair of error and element that wasn't pushed.
Pushes elements from slice into ring buffer. Elements should be be cloneable.
On success returns count of elements been pushed into ring buffer.
pub unsafe fn push_access<R, E, F>( &mut self, f: F ) -> Result<Result<(usize, R), E>, PushAccessError> where R: Sized, E: Sized, F: FnOnce(&mut [T], &mut [T]) -> Result<(usize, R), E>, | [src] |
Allows to write into ring buffer memory directry.
This function is unsafe beacuse it gives access to possibly uninitialized memory
and transfers responsibility of manually calling destructors
Takes a function f
as argument.
f
takes two slices of ring buffer content (the second one may be empty). First slice contains older elements.
f
should return:
- On success: pair of number of elements been written, and some arbitrary data.
- On failure: some another arbitrary data.
On success returns data returned from f
.
Write a buffer into this writer, returning how many bytes were written. Read more
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
Attempts to write an entire buffer into this writer. Read more
Writes a formatted string into this writer, returning any error encountered. Read more
Creates a "by reference" adaptor for this instance of Write
. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static