#![allow(dead_code)]
use cc_talk_core::cc_talk::Header;
pub trait Command {
type Response;
fn header(&self) -> Header;
fn data(&self) -> &[u8];
fn parse_response(&self, response_payload: &[u8])
-> Result<Self::Response, ParseResponseError>;
}
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
pub enum ParseResponseError {
#[error("data length mismatch: expected {0} bytes, got {1} bytes")]
DataLengthMismatch(usize, usize),
#[error("parse error: {0}")]
ParseError(&'static str),
#[error("buffer too small to hold response data")]
BufferTooSmall,
}