use bytes::BytesMut;
use crate::decoding::Parsable;
use crate::encoding::Writable;
use crate::ProtocolError;
#[derive(Debug, Clone)]
pub struct Abort;
impl Parsable for Abort {
const CODE: u8 = b'A';
fn parse(_buffer: BytesMut) -> Result<Self, ProtocolError> {
Ok(Self)
}
}
impl Writable for Abort {
fn write(&self, _buffer: &mut BytesMut) {}
fn len(&self) -> usize {
0
}
fn code(&self) -> u8 {
Self::CODE
}
fn is_empty(&self) -> bool {
self.len() == 0
}
}
#[derive(Debug, Clone)]
pub struct Continue;
impl Continue {
const CODE: u8 = b'c';
}
impl Parsable for Continue {
const CODE: u8 = Self::CODE;
fn parse(_buffer: BytesMut) -> Result<Self, ProtocolError> {
Ok(Self)
}
}
impl Writable for Continue {
fn write(&self, _buffer: &mut BytesMut) {}
fn len(&self) -> usize {
0
}
fn code(&self) -> u8 {
Self::CODE
}
fn is_empty(&self) -> bool {
self.len() == 0
}
}