pub(crate) struct PipeRingBuffer {
buffer: RingBuffer,
write_end: Option<Weak<Pipe>>,
}Expand description
管道环形缓冲区
Fields§
§buffer: RingBuffer§write_end: Option<Weak<Pipe>>Implementations§
Source§impl PipeRingBuffer
impl PipeRingBuffer
Sourcepub fn write_byte(&mut self, byte: u8) -> Result<(), ()>
pub fn write_byte(&mut self, byte: u8) -> Result<(), ()>
写入一个字节
Sourcepub fn available_space(&self) -> usize
pub fn available_space(&self) -> usize
可用空间
Sourcepub fn set_write_end(&mut self, write_end: &Arc<Pipe>)
pub fn set_write_end(&mut self, write_end: &Arc<Pipe>)
设置写端
Sourcepub fn all_write_ends_dropped(&self) -> bool
pub fn all_write_ends_dropped(&self) -> bool
检查是否所有写端都已被丢弃