pub struct StreamBox { /* private fields */ }Expand description
Sized wrapper around dyn SemaStream for NaN-boxing (thin pointer via Rc
Implementations§
Source§impl StreamBox
impl StreamBox
pub fn new(s: impl SemaStream + 'static) -> Self
pub fn read(&self, buf: &mut [u8]) -> Result<usize, SemaError>
pub fn write(&self, data: &[u8]) -> Result<usize, SemaError>
pub fn flush(&self) -> Result<(), SemaError>
pub fn close(&self) -> Result<(), SemaError>
pub fn is_closed(&self) -> bool
pub fn is_readable(&self) -> bool
pub fn is_writable(&self) -> bool
pub fn available(&self) -> Result<bool, SemaError>
pub fn stream_type(&self) -> &'static str
pub fn borrow_inner(&self) -> Ref<'_, Box<dyn SemaStream>>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for StreamBox
impl !RefUnwindSafe for StreamBox
impl !Send for StreamBox
impl !Sync for StreamBox
impl Unpin for StreamBox
impl UnsafeUnpin for StreamBox
impl !UnwindSafe for StreamBox
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