[−][src]Struct spsc_bip_buffer::BipBufferWriter
Represents the send side of the single-producer single-consumer circular buffer.
BipBufferWriter
is Send
so you can move it to the sender thread.
Methods
impl BipBufferWriter
[src]
pub fn reserve(&mut self, len: usize) -> Option<BipBufferWriterReservation>
[src]
Attempt to reserve the requested number of bytes. If no contiguous len
bytes are available
in the circular buffer, this method returns None
: check spin_reserve
for a method that
busy waits till space is available.
If successful, it returns a reservation that the sender can use to write data to the buffer. Dropping the reservation signals completion of the write and makes the data available to the reader.
pub fn spin_reserve(&mut self, len: usize) -> BipBufferWriterReservation
[src]
Reserve the requested number of bytes. This method busy-waits until len
contiguous bytes
are available in the circular buffer.
If successful, it returns a reservation that the sender can use to write data to the buffer. Dropping the reservation signals completion of the write and makes the data available to the reader.
Busy-waiting
If the current thread is scheduled on the same core as the receiver, busy-waiting may compete with the receiver [...]
pub fn try_unwrap<B: DerefMut<Target = [u8]> + 'static>(self) -> Result<B, Self>
[src]
Attempts to recover the underlying storage. B must be the type of the storage passed to
bip_buffer_from
. If the BipBufferReader
side still exists, this will fail and return
Err(self)
. If the BipBufferReader
side was dropped, this will return the underlying
storage.
Panic
Panics if B is not the type of the underlying storage.
Trait Implementations
impl Send for BipBufferWriter
[src]
Auto Trait Implementations
impl !Sync for BipBufferWriter
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,