use std::io::IoSlice;
use crate::ll::{ioslice_concat::IosliceConcat, reply::Response};
#[derive(Debug)]
pub struct DataResponse {
data: Vec<u8>,
}
impl DataResponse {
pub fn new(data: Vec<u8>) -> Self {
Self { data }
}
fn bytes(&self) -> &[u8] {
self.data.as_slice()
}
}
impl Response for DataResponse {
fn payload(&self) -> impl IosliceConcat {
[IoSlice::new(self.bytes())]
}
}