pub struct SharedBuf { /* private fields */ }
Implementations§
pub fn new(max_len: usize) -> Self
pub fn has_data(&self) -> bool
pub fn max_len(&self) -> usize
pub fn space_available(&self) -> usize
sourcepub fn add_reader(&mut self, cb_queue: &mut CallbackQueue) -> ReaderHandle
pub fn add_reader(&mut self, cb_queue: &mut CallbackQueue) -> ReaderHandle
Register as a reader. The ReaderHandle
must be returned to the buffer later with
remove_reader()
.
pub fn remove_reader( &mut self, handle: ReaderHandle, cb_queue: &mut CallbackQueue, )
pub fn num_readers(&self) -> u16
sourcepub fn add_writer(&mut self, cb_queue: &mut CallbackQueue) -> WriterHandle
pub fn add_writer(&mut self, cb_queue: &mut CallbackQueue) -> WriterHandle
Register as a writer. The WriterHandle
must be returned to the buffer later with
remove_writer()
.
pub fn remove_writer( &mut self, handle: WriterHandle, cb_queue: &mut CallbackQueue, )
pub fn num_writers(&self) -> u16
pub fn peek<W: Write>(&self, bytes: W) -> Result<(usize, usize), Error>
pub fn read<W: Write>( &mut self, bytes: W, cb_queue: &mut CallbackQueue, ) -> Result<(usize, usize), Error>
pub fn write_stream<R: Read>( &mut self, bytes: R, len: usize, cb_queue: &mut CallbackQueue, ) -> Result<usize, Error>
pub fn write_packet<R: Read>( &mut self, bytes: R, len: usize, cb_queue: &mut CallbackQueue, ) -> Result<(), Error>
pub fn add_listener( &mut self, monitoring_state: BufferState, monitoring_signals: BufferSignals, notify_fn: impl Fn(BufferState, BufferSignals, &mut CallbackQueue) + Send + Sync + 'static, ) -> BufferHandle
pub fn state(&self) -> BufferState
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more