pub struct EventReader {
pub fm_receiver: Receiver<FmEvents>,
pub socket_path: String,
pub socket_listener: UnixListener,
}Expand description
Simple struct to read the events.
Fields§
§fm_receiver: Receiver<FmEvents>§socket_path: String§socket_listener: UnixListenerImplementations§
Source§impl EventReader
impl EventReader
Sourcepub fn new(fm_receiver: Receiver<FmEvents>) -> Self
pub fn new(fm_receiver: Receiver<FmEvents>) -> Self
Creates a new instance with an Arc to a terminal.
Sourcepub fn poll_event(&self) -> FmEvents
pub fn poll_event(&self) -> FmEvents
Returns the events as they’re received. Loops until an event is received. We should spend most of the application life here, polling for next event :)
It’s an interface for internal and extenal events (through terminal)
casting them into an crate::event::FmEvents.
Auto Trait Implementations§
impl Freeze for EventReader
impl RefUnwindSafe for EventReader
impl Send for EventReader
impl !Sync for EventReader
impl Unpin for EventReader
impl UnsafeUnpin for EventReader
impl UnwindSafe for EventReader
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.