|
|
|
|
@ -15,13 +15,16 @@
|
|
|
|
|
* 02110-1301, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
use crate::debug_validate_fail;
|
|
|
|
|
|
|
|
|
|
pub const DIR_BOTH: u8 = 0b0000_1100;
|
|
|
|
|
const DIR_TOSERVER: u8 = 0b0000_0100;
|
|
|
|
|
const DIR_TOCLIENT: u8 = 0b0000_1000;
|
|
|
|
|
|
|
|
|
|
#[repr(C)]
|
|
|
|
|
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
|
|
|
|
#[derive(Debug, Default, PartialEq, Eq, Clone, Copy)]
|
|
|
|
|
pub enum Direction {
|
|
|
|
|
#[default]
|
|
|
|
|
ToServer = 0x04,
|
|
|
|
|
ToClient = 0x08,
|
|
|
|
|
}
|
|
|
|
|
@ -45,12 +48,6 @@ impl Direction {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Default for Direction {
|
|
|
|
|
fn default() -> Self {
|
|
|
|
|
Direction::ToServer
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl std::fmt::Display for Direction {
|
|
|
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
|
|
|
match self {
|