You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: event.rs
    path of file: ./repos/systeroid/systeroid-tui/src
    
    the code of the file until where you have to start completion: use std::io;
use std::sync::mpsc::{self, Receiver, RecvError, Sender};
use std::thread;
use std::time::Duration;
use termion::event::Key;
use termion::input::TermRead;

/// Representation of terminal events.
#[derive(Clone, Copy, Debug)]
pub enum Event {
    /// A key press event.
    KeyPress(Key),
    /// A terminal refresh event.
    Tick,
}

/// [`Event`] handler.
#[derive(Debug)]
pub struct EventHandler {
    /// Sender channel for the events.
    #[allow(dead_code)]
    sender: Sender<Event>,
    /// Receiver channel for the events.
    receiver: Receiver<Event>,
}

impl EventHandler {
    /// Constructs a new event handler with the given refresh rate.
    pub fn new(tick_rate: u64) -> Sel
    
    pub fn new(tick_rate: u64) -> Self {
        let tick_rate = Duration::from_millis(tick_rate);
        let (sender, receiver) = mpsc::channel();
        {
            let sender = sender.clone();
            thread::spawn(move || loop {
                io::stdin()
                    .keys()
                    .flatten()
                    .try_for_each(|key| sender.send(Event::KeyPress(key)))
                    .expect("failed to send key input event");
            });
        }
        {
            let sender = sender.clone();
            thread::spawn(move || loop {
                sender.send(Event::Tick).expect("failed to send tick event");
                thread::sleep(tick_rate);
            });
        }
        Self { sender, receiver }
    }