use crate::ProxyEvent;
pub trait ProtocolHandler: Send + Sync {
fn parse_request(&self, buf: &[u8]) -> Option<String>;
fn extract_full_command(&self, buf: &[u8]) -> Option<String> {
self.parse_request(buf)
}
fn parse_response(&self, buf: &[u8]) -> Option<String>;
fn format_response_detail(&self, buf: &[u8]) -> Option<String> {
self.parse_response(buf)
}
fn to_replay_command(&self, ev: &ProxyEvent) -> String {
ev.full_command.clone()
}
fn needs_request_buffering(&self) -> bool { false }
fn needs_response_buffering(&self) -> bool { false }
fn request_complete(&self, _buf: &[u8]) -> bool { true }
fn response_complete(&self, _buf: &[u8]) -> bool { true }
fn is_frame_based(&self) -> bool { false }
}