mod algorithm;
pub(crate) mod commands;
pub use self::algorithm::Algorithm;
use crate::ssh;
#[derive(Debug)]
pub enum Template {
Ssh(ssh::Template),
}
impl Template {
pub fn algorithm(&self) -> Algorithm {
match self {
Template::Ssh(_) => Algorithm::Ssh,
}
}
pub fn ssh(&self) -> Option<&ssh::Template> {
match self {
Template::Ssh(ssh) => Some(ssh),
}
}
}
impl From<ssh::Template> for Template {
fn from(template: ssh::Template) -> Template {
Template::Ssh(template)
}
}
impl AsRef<[u8]> for Template {
fn as_ref(&self) -> &[u8] {
match self {
Template::Ssh(ssh) => ssh.as_ref(),
}
}
}