From cea3d3da043fe23ceffb44cc9f60299e624386d9 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 13 Dec 2024 17:08:59 +0100 Subject: [PATCH] commands: add a few TODOs --- src/commands.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/commands.rs b/src/commands.rs index 28fbb36..c7b9050 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -34,6 +34,10 @@ pub trait Command { // The command name used within the protocol const COMMAND: &'static str; + // TODO: `parse_request` should be using a more custom splitter, that can handle + // quoted strings and escape characters. This is what mpd uses to provide arguments + // with spaces and whatnot. + // A function to parse the remaining parts of the command, split by whitespace fn parse_request(parts: SplitWhitespace<'_>) -> RequestParserResult<'_>; @@ -76,7 +80,7 @@ pub trait Command { .next() .ok_or(ResponseParserError::SyntaxError(0, line))?; - // TODO: handle binary data + // TODO: handle binary data, also verify binarylimit let value = keyval .next() .ok_or(ResponseParserError::SyntaxError(0, line))?; @@ -168,6 +172,10 @@ impl<'a> From)>> for ResponseAttributes<' } } +// TODO: There should probably be a helper that lets you extract and verify one, two or maybe +// three properties without having to allocate a hashmap to get a nice API. We can retrieve +// the properties by name with a loop on the inner vec. + /*******************/ /* Parsing Helpers */ /*******************/