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: deployer.rs
    path of file: ./repos/small-deployer/src
    
    the code of the file until where you have to start completion: use std::os::unix::prelude::*;
use std::sync::mpsc::{TryRecvError, Receiver};
use std::convert::AsRef;
use small_logger::runner;

use std::ops::Sub;

use time;

use slack_hook::{Slack, Payload, PayloadTemplate};
use hook_configuration::{HookConfig, HookAction, SlackConfiguration};
use tools::to_string;

#[derive(Clone)]
#[allow(dead_code)]
pub enum DeployMessage {
    Deploy(HookConfig),
    Exit,
}

pub struct Deployer {
    pub name: String,
    pub conf: HookAction,
    pub slack: Option<SlackConfiguration>,
}

impl Deployer {
    pub fn run(&self, rx: Receiver<DeployMessage>) {
        self.log("Starting deployer.");
        while {
            let deploy_instruction
    
    fn message(&self, message: String) {
        match self.slack {
            Some(ref conf) => {
                // http://www.emoji-cheat-sheet.com/
                let slack = Slack::new(conf.webhook_url.as_ref());
                let p = Payload::new(PayloadTemplate::Complete {
                    text: Some(message.as_ref()),
                    channel: Some(conf.channel.as_ref()),
                    username: Some(conf.username.as_ref()),
                    icon_url: match conf.icon_url {
                        None => None,
                        Some(ref s) => Some(s.as_ref()),
                    },
                    icon_emoji: match conf.icon_emoji {
                        None => None,
                        Some(ref s) => Some(s.as_ref()),
                    },
                    attachments: None,
                    unfurl_links: Some(true),
                    link_names: Some(false),
                });

                match slack.send(&p) {
                    Ok(()) => self.log("Sent notification to slack."),
                    Err(x) => println!("ERR: {:?}", x),
                }
            }
            None => {}
        }

    }