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>
impl<TS: ThreadSafety> Filter<TS>
Sourcepub fn new(inner: &EventLoop<Wakeup>) -> Filter<TS>
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.
Sourcepub 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,
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> !RefUnwindSafe for Filter<TS>
impl<TS> !Sync for Filter<TS>
impl<TS> Freeze for Filter<TS>where
<TS as __ThreadSafety>::Rc<Reactor<TS>>: Freeze,
impl<TS> Send for Filter<TS>where
<TS as __ThreadSafety>::Rc<Reactor<TS>>: Send,
impl<TS> Unpin for Filter<TS>where
<TS as __ThreadSafety>::Rc<Reactor<TS>>: Unpin,
impl<TS> UnsafeUnpin for Filter<TS>where
<TS as __ThreadSafety>::Rc<Reactor<TS>>: UnsafeUnpin,
impl<TS> UnwindSafe for Filter<TS>where
<TS as __ThreadSafety>::Rc<Reactor<TS>>: UnwindSafe,
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