use actix::Message;
use bytes::Bytes;

pub use crate::terminado::TerminadoMessage;

#[derive(Debug, Eq, PartialEq, Clone)]
pub struct IO(pub Bytes);

impl Message for IO {
    type Result = ();
}

impl From<Bytes> for IO {
    fn from(b: Bytes) -> Self {
        Self(b)
    }
}

impl From<String> for IO {
    fn from(s: String) -> Self {
        Self(Bytes::from(s))
    }
}

impl From<&str> for IO {
    fn from(s: &str) -> Self {
        Self(Bytes::from(s.to_owned()))
    }
}

#[derive(Debug, Clone)]
pub struct ChildDied();

impl Message for ChildDied {
    type Result = ();
}
