36 lines
1.0 KiB
Rust
36 lines
1.0 KiB
Rust
use crate::commands::{
|
|
Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
|
|
ResponseParserError,
|
|
};
|
|
|
|
pub struct OutputSet;
|
|
|
|
impl Command for OutputSet {
|
|
type Response = ();
|
|
const COMMAND: &'static str = "outputset";
|
|
|
|
fn parse_request(mut parts: std::str::SplitWhitespace<'_>) -> RequestParserResult<'_> {
|
|
let output_id = parts.next().ok_or(RequestParserError::UnexpectedEOF)?;
|
|
let attribute_name = parts.next().ok_or(RequestParserError::UnexpectedEOF)?;
|
|
let attribute_value = parts.next().ok_or(RequestParserError::UnexpectedEOF)?;
|
|
|
|
debug_assert!(parts.next().is_none());
|
|
|
|
Ok((
|
|
Request::OutputSet(
|
|
output_id.to_string(),
|
|
attribute_name.to_string(),
|
|
attribute_value.to_string(),
|
|
),
|
|
"",
|
|
))
|
|
}
|
|
|
|
fn parse_response(
|
|
parts: ResponseAttributes<'_>,
|
|
) -> Result<Self::Response, ResponseParserError> {
|
|
debug_assert!(parts.is_empty());
|
|
Ok(())
|
|
}
|
|
}
|