commands: add a few TODOs
This commit is contained in:
parent
87fa93fb1c
commit
cea3d3da04
@ -34,6 +34,10 @@ pub trait Command {
|
|||||||
// The command name used within the protocol
|
// The command name used within the protocol
|
||||||
const COMMAND: &'static str;
|
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
|
// A function to parse the remaining parts of the command, split by whitespace
|
||||||
fn parse_request(parts: SplitWhitespace<'_>) -> RequestParserResult<'_>;
|
fn parse_request(parts: SplitWhitespace<'_>) -> RequestParserResult<'_>;
|
||||||
|
|
||||||
@ -76,7 +80,7 @@ pub trait Command {
|
|||||||
.next()
|
.next()
|
||||||
.ok_or(ResponseParserError::SyntaxError(0, line))?;
|
.ok_or(ResponseParserError::SyntaxError(0, line))?;
|
||||||
|
|
||||||
// TODO: handle binary data
|
// TODO: handle binary data, also verify binarylimit
|
||||||
let value = keyval
|
let value = keyval
|
||||||
.next()
|
.next()
|
||||||
.ok_or(ResponseParserError::SyntaxError(0, line))?;
|
.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 */
|
/* Parsing Helpers */
|
||||||
/*******************/
|
/*******************/
|
||||||
|
Loading…
Reference in New Issue
Block a user