#[derive(Debug)]
pub struct VerifyData {
pub error_frame: Vec<u8>,
pub data_frame: Vec<u8>,
pub too_short_frame: Vec<u8>,
pub next_verify_frame: Vec<u8>,
}
impl VerifyData {
pub fn fail(error_frame: Vec<u8>) -> Self {
Self::new(error_frame, Vec::new())
}
pub fn success(data_frame: Vec<u8>) -> Self {
Self::new(Vec::new(), data_frame)
}
pub fn too_short(error_frame: Vec<u8>, too_short_frame: Vec<u8>) -> Self {
Self::new_with_too_short_frame(error_frame, Vec::new(), too_short_frame)
}
pub fn next_verify(error_frame: Vec<u8>, next_verify_frame: Vec<u8>) -> Self {
Self { error_frame, data_frame: Vec::new(), too_short_frame: Vec::new(), next_verify_frame }
}
pub fn new(error_frame: Vec<u8>, data_frame: Vec<u8>) -> Self {
Self::new_with_too_short_frame(error_frame, data_frame, Vec::new())
}
pub fn new_with_too_short_frame(error_frame: Vec<u8>, data_frame: Vec<u8>, too_short_frame: Vec<u8>) -> Self {
Self { error_frame, data_frame, too_short_frame, next_verify_frame: Vec::new() }
}
}