Struct Thread

Source
pub struct Thread<EventProvider, CustomEvent>
where EventProvider: EventReaderFn, CustomEvent: CustomEvent + 'static,
{ /* private fields */ }
Expand description

A thread for reading and handling input events.

Implementations§

Source§

impl<EventProvider, CustomEvent> Thread<EventProvider, CustomEvent>
where EventProvider: EventReaderFn, CustomEvent: CustomEvent + 'static,

Source

pub fn new(event_provider: EventProvider) -> Self

Create a new instance of a thread.

Source

pub fn state(&self) -> State<CustomEvent>

Get a cloned copy of the state of the thread.

Trait Implementations§

Source§

impl<EventProvider, CustomEvent> Debug for Thread<EventProvider, CustomEvent>
where EventProvider: EventReaderFn + Debug, CustomEvent: CustomEvent + 'static + Debug,

Source§

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

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

impl<EventProvider, CustomEvent> Threadable for Thread<EventProvider, CustomEvent>
where EventProvider: EventReaderFn, CustomEvent: CustomEvent + Send + Sync + 'static,

Source§

fn install(&self, installer: &Installer)

Method that installs the threads that the Threadable is responsible for.
Source§

fn pause(&self)

Called when threads are requested to pause. Read more
Source§

fn resume(&self)

Called when threads are requested to resume. Read more
Source§

fn end(&self)

Called when threads are requested to finish. Read more

Auto Trait Implementations§

§

impl<EventProvider, CustomEvent> Freeze for Thread<EventProvider, CustomEvent>

§

impl<EventProvider, CustomEvent> !RefUnwindSafe for Thread<EventProvider, CustomEvent>

§

impl<EventProvider, CustomEvent> Send for Thread<EventProvider, CustomEvent>
where CustomEvent: Send,

§

impl<EventProvider, CustomEvent> Sync for Thread<EventProvider, CustomEvent>
where CustomEvent: Send,

§

impl<EventProvider, CustomEvent> Unpin for Thread<EventProvider, CustomEvent>

§

impl<EventProvider, CustomEvent> !UnwindSafe for Thread<EventProvider, CustomEvent>

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

impl<T> ErasedDestructor for T
where T: 'static,