pub struct PipeRingBuffer {
arr: [u8; 32],
head: usize,
tail: usize,
status: RingBufferStatus,
write_end: Option<Weak<Pipe>>,
}Expand description
The underlying ring buffer of a pipe
Fields
arr: [u8; 32]head: usizetail: usizestatus: RingBufferStatuswrite_end: Option<Weak<Pipe>>Implementations
sourceimpl PipeRingBuffer
impl PipeRingBuffer
pub fn new() -> Self
sourcepub fn set_write_end(&mut self, write_end: &Arc<Pipe>)
pub fn set_write_end(&mut self, write_end: &Arc<Pipe>)
Set the write end bound to this buffer
sourcepub fn write_byte(&mut self, byte: u8)
pub fn write_byte(&mut self, byte: u8)
Write into the buffer
sourcepub fn available_read(&self) -> usize
pub fn available_read(&self) -> usize
Get the length of remaining data in the buffer
sourcepub fn available_write(&self) -> usize
pub fn available_write(&self) -> usize
Get the length of remaining space in the buffer
sourcepub fn all_write_ends_closed(&self) -> bool
pub fn all_write_ends_closed(&self) -> bool
Check if all write ends bounded to this buffer are closed
Auto Trait Implementations
impl !RefUnwindSafe for PipeRingBuffer
impl Send for PipeRingBuffer
impl Sync for PipeRingBuffer
impl Unpin for PipeRingBuffer
impl !UnwindSafe for PipeRingBuffer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more