use std::fmt;
use std::path::PathBuf;
use std::sync::Arc;
pub trait KeyLog: Send + Sync + fmt::Debug {
fn log(&self, label: &str, client_random: &[u8], secret: &[u8]);
}
#[derive(Clone)]
pub enum KeyLogPolicy {
Disabled,
File(PathBuf),
Custom(Arc<dyn KeyLog>),
}
impl fmt::Debug for KeyLogPolicy {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
KeyLogPolicy::Disabled => write!(f, "KeyLogPolicy::Disabled"),
KeyLogPolicy::File(path) => write!(f, "KeyLogPolicy::File({path:?})"),
KeyLogPolicy::Custom(_) => write!(f, "KeyLogPolicy::Custom(<KeyLog impl>)"),
}
}
}