use bytes::Bytes;
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct FramingMessage {
pub data: Bytes,
pub padding: Bytes,
}
impl FramingMessage {
pub fn new(data: Bytes, padding: Bytes) -> Self {
Self { data, padding }
}
pub fn new_data(data: Bytes) -> Self {
Self::new(data, Bytes::new())
}
pub fn new_padding(padding: Bytes) -> Self {
Self::new(Bytes::new(), padding)
}
}