Struct tiny_web::sys::worker::StreamRead
source · pub struct StreamRead { /* private fields */ }Expand description
Half of the network to read
Implementations§
source§impl StreamRead
impl StreamRead
sourcepub async fn read(&mut self, timeout: u64) -> Result<(), StreamError>
pub async fn read(&mut self, timeout: u64) -> Result<(), StreamError>
Read from stream to buffer
Params
timeout: u64- How long to wait for a reading? (in milliseconds)
If timeout = 0, it will wait until data appears or an error occurs.
After StreamError::Timeout, saving data in the buffer and correct operation of the protocol are not guaranteed, so it is advisable to close the stream.
Auto Trait Implementations§
impl RefUnwindSafe for StreamRead
impl Send for StreamRead
impl Sync for StreamRead
impl Unpin for StreamRead
impl UnwindSafe for StreamRead
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