pub struct EventStreamGroup { /* private fields */ }Expand description
Allows waiting for events from any one of several streams on the same client
Implementations§
Source§impl EventStreamGroup
impl EventStreamGroup
Sourcepub fn new(client: &HlapiClient) -> Self
pub fn new(client: &HlapiClient) -> Self
Creates a new poller for streams on the given client
Sourcepub fn add<T: 'static + Send>(&mut self, stream: &EventStream<T>)
pub fn add<T: 'static + Send>(&mut self, stream: &EventStream<T>)
Sourcepub fn remove<T: 'static + Send>(&mut self, stream: &EventStream<T>)
pub fn remove<T: 'static + Send>(&mut self, stream: &EventStream<T>)
Removes a stream from the list of streams to be polled
Sourcepub fn wait_for_event(
&self,
timeout: Option<Duration>,
) -> Result<bool, HlapiClientError>
pub fn wait_for_event( &self, timeout: Option<Duration>, ) -> Result<bool, HlapiClientError>
Waits until one of the registered streams has an event, with an optional timeout. A zero
duration means a non-blocking wait (i.e. just check if any stream has an event), and None
means wait forever. Returns Ok(true) if one has an event, Ok(false) if the timeout was hit,
and Err if there was an error. The stream’s client is unusable by other threads while this
method is running.
Auto Trait Implementations§
impl !RefUnwindSafe for EventStreamGroup
impl !UnwindSafe for EventStreamGroup
impl Freeze for EventStreamGroup
impl Send for EventStreamGroup
impl Sync for EventStreamGroup
impl Unpin for EventStreamGroup
impl UnsafeUnpin for EventStreamGroup
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