Struct Filter

Source
pub struct Filter<TS: ThreadSafety> { /* private fields */ }
Expand description

The filter for passing events to async contexts.

This type takes events and passes them to the event handlers. It also handles the async contexts that are waiting for events.

Implementations§

Source§

impl<TS: ThreadSafety> Filter<TS>

Source

pub fn new(inner: &EventLoop<Wakeup>) -> Filter<TS>

Create a new filter from an event loop.

The future is polled once before returning to set up event handlers.

Source

pub fn handle_event<F>( &mut self, future: Pin<&mut F>, event: Event<'_, Wakeup>, elwt: &EventLoopWindowTarget<Wakeup>, flow: &mut ControlFlow, ) -> ReturnOrFinish<(), F::Output>
where F: Future,

Handle an event.

This function will block on the future if it is in the holding pattern.

Auto Trait Implementations§

§

impl<TS> Freeze for Filter<TS>
where <TS as __ThreadSafety>::Rc<Reactor<TS>>: Freeze,

§

impl<TS> !RefUnwindSafe for Filter<TS>

§

impl<TS> Send for Filter<TS>
where <TS as __ThreadSafety>::Rc<Reactor<TS>>: Send,

§

impl<TS> !Sync for Filter<TS>

§

impl<TS> Unpin for Filter<TS>
where <TS as __ThreadSafety>::Rc<Reactor<TS>>: Unpin,

§

impl<TS> UnwindSafe for Filter<TS>
where <TS as __ThreadSafety>::Rc<Reactor<TS>>: UnwindSafe,

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.

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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
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.