commands: add a few TODOs
Some checks failed
Build and test / build (push) Successful in 57s
Build and test / check (push) Failing after 57s
Build and test / docs (push) Successful in 1m8s
Build and test / test (push) Successful in 1m27s

This commit is contained in:
Oystein Kristoffer Tveit 2024-12-13 17:08:59 +01:00
parent 87fa93fb1c
commit cea3d3da04
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146

View File

@ -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<Vec<(&'a str, GenericResponseValue<'a>)>> 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 */
/*******************/