pub struct FileEventFuture<E> { /* private fields */ }Expand description
The next event from a player or recorder, or None when none arrives
within the timeout.
The wait starts when the future is first polled, and ends on time even
while the player’s or recorder’s thread is busy with a command that
blocks: a timer thread shared by every handle in the process keeps the
deadline. Events queued by the deadline remain eligible even if the
executor polls later. A zero timeout can take an already queued event.
Events queued after a wait’s deadline are available to later waits.
One future may wait on a handle at a time. It keeps its claim to the queue
through shutdown until it completes or is dropped. A second wait fails
with Error::InvalidState and StateConflict::WaiterPending. With an
empty queue, a shutdown published by the deadline reports
StateConflict::Closed, or StateConflict::OwnerFailed when the thread
failed. A shutdown published after the deadline leaves the expired wait’s
result as None. When recorder shutdown begins with no submitted
finish or
wait_for_finish pending, the queue
closes immediately. Cleanup events, including the last file-closed event,
are never added to that queue. Await finish before close to observe them.
Dropping the future leaves event pumping active.
Executor callbacks run on File threads; a handle’s last clone dropped
there requests shutdown without waiting for native cleanup.
§Errors
Besides those above, Error::InvalidInput when the timeout exceeds
crate::MAX_TIMEOUT, Error::UnexpectedSdkResult for a whole-event
layout or type mismatch, and Error::Io when the wait has to be
timed and the timer thread cannot be started; a later wait tries to start
it again.
An unreadable format is withheld through PlayerEvent::source_format
or RecorderEvent::source_format while the event is delivered.
§Panics
Polling again after completion panics.