Struct s2n_quic_transport::stream::StreamEvents
source · [−]Expand description
Events that are triggered through a state-update on a Stream. E.g. retrieving new data can unblock readers, which is signalled via this Event.
Fields
read_wake: Option<Waker>
A task that is waiting on the reading half of the Stream that might have been woken up due to an action.
write_wake: Option<Waker>
A task that is waiting on the writing half of the Stream that might have been woken up due to an action.
Implementations
sourceimpl StreamEvents
impl StreamEvents
sourcepub fn new() -> StreamEvents
pub fn new() -> StreamEvents
Creates a new StreamEvents
instance with no pending events
sourcepub fn waker_count(&self) -> usize
pub fn waker_count(&self) -> usize
Returns the amount of Waker
instances that are stored in the event
sourcepub fn store_read_waker(&mut self, waker: Waker)
pub fn store_read_waker(&mut self, waker: Waker)
Stores a Waker
which was waiting on the reading half of the Stream
to get ready. The Waker
will get woken up by the consumer of
StreamEvents
.
sourcepub fn store_write_waker(&mut self, waker: Waker)
pub fn store_write_waker(&mut self, waker: Waker)
Stores a Waker
which was waiting on the writing half of the Stream
to get ready. The Waker
will get woken up by the consumer of
StreamEvents
.
sourcepub fn wake_all(&mut self)
pub fn wake_all(&mut self)
Wakes all Waker
instances that have been stored via add_waker
.
Waking the Waker
s will remove them from the StreamEvents
s struct.
Trait Implementations
sourceimpl Debug for StreamEvents
impl Debug for StreamEvents
sourceimpl Default for StreamEvents
impl Default for StreamEvents
sourcefn default() -> StreamEvents
fn default() -> StreamEvents
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for StreamEvents
impl Send for StreamEvents
impl Sync for StreamEvents
impl Unpin for StreamEvents
impl UnwindSafe for StreamEvents
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more