From 823f4a306a4dcc93133baf19af564154f4c16ec4 Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Wed, 11 Dec 2024 12:49:02 +0100 Subject: [PATCH] allow calling `Protocols` from BinaryParser --- src/protocols/binary_protocol.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/protocols/binary_protocol.rs b/src/protocols/binary_protocol.rs index b7c0996..5bb0a13 100644 --- a/src/protocols/binary_protocol.rs +++ b/src/protocols/binary_protocol.rs @@ -7,6 +7,7 @@ use crate::{Canvas, Color, Command, Response}; use super::{IOProtocol, Parser, Responder}; const SIZE_BIN: u8 = 115; +const PROTOCOLS_BIN: u8 = 116; const HELP_BIN: u8 = 104; const GET_PX_BIN: u8 = 32; const SET_PX_RGB_BIN: u8 = 128; @@ -22,6 +23,7 @@ impl Parser for Binar match fst { Ok(command) => match command { HELP_BIN => Ok(Command::Help), + PROTOCOLS_BIN => Ok(Command::Protocols), SIZE_BIN => { let canvas = reader.read_u8().await?; Ok(Command::Size(canvas))