Skip to main content

FileEventFuture

Struct FileEventFuture 

Source
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.

Trait Implementations§

Source§

impl<E> Debug for FileEventFuture<E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<E> Drop for FileEventFuture<E>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<E> Future for FileEventFuture<E>

Source§

type Output = Result<Option<E>, Error>

The type of value produced on completion.
Source§

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

Attempts to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more

Auto Trait Implementations§

§

impl<E> !RefUnwindSafe for FileEventFuture<E>

§

impl<E> !UnwindSafe for FileEventFuture<E>

§

impl<E> Freeze for FileEventFuture<E>

§

impl<E> Send for FileEventFuture<E>
where E: Send,

§

impl<E> Sync for FileEventFuture<E>
where E: Send,

§

impl<E> Unpin for FileEventFuture<E>

§

impl<E> UnsafeUnpin for FileEventFuture<E>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<F> FutureExt for F
where F: Future + ?Sized,

§

fn poll(&mut self, cx: &mut Context<'_>) -> Poll<Self::Output>
where Self: Unpin,

A convenience for calling Future::poll() on !Unpin types.
§

fn or<F>(self, other: F) -> Or<Self, F> ⓘ
where Self: Sized, F: Future<Output = Self::Output>,

Returns the result of self or other future, preferring self if both are ready. Read more
§

fn race<F>(self, other: F) -> Race<Self, F> ⓘ
where Self: Sized, F: Future<Output = Self::Output>,

Returns the result of self or other future, with no preference if both are ready. Read more
§

fn catch_unwind(self) -> CatchUnwind<Self> ⓘ
where Self: Sized + UnwindSafe,

Catches panics while polling the future. Read more
§

fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
where Self: Sized + Send + 'a,

Boxes the future and changes its type to dyn Future + Send + 'a. Read more
§

fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>
where Self: Sized + 'a,

Boxes the future and changes its type to dyn Future + 'a. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<F> IntoFuture for F
where F: Future,

Source§

type Output = <F as Future>::Output

The output that the future will produce on completion.
Source§

type IntoFuture = F

Which kind of future are we turning this into?
Source§

fn into_future(self) -> <F as IntoFuture>::IntoFuture

Creates a future from a value. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

impl<F, T, E> TryFuture for F
where F: Future<Output = Result<T, E>> + ?Sized,

§

type Ok = T

The type of successful values yielded by this future
§

type Error = E

The type of failures yielded by this future
§

fn try_poll( self: Pin<&mut F>, cx: &mut Context<'_>, ) -> Poll<<F as Future>::Output>

Poll this TryFuture as if it were a Future. Read more
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.