Documentation
use speedy::LittleEndian;

#[derive(Debug, Clone)]
pub struct Task {
  pub host: Box<str>,
  pub arg: Vec<u8>,
  pub tag_li: Box<[String]>,
  pub interval: u64,
}

impl Task {
  pub fn new(
    host: impl AsRef<str>,
    arg: impl speedy::Writable<LittleEndian>,
    tag_li: impl Into<Box<[String]>>,
    interval: u64,
  ) -> Self {
    Self {
      interval,
      host: host.as_ref().into(),
      arg: arg.write_to_vec().unwrap(),
      tag_li: tag_li.into(),
    }
  }
}