add response for protocol status
This commit is contained in:
parent
4a230a08c2
commit
232fe6b6e2
3 changed files with 41 additions and 0 deletions
|
|
@ -146,6 +146,23 @@ impl<W: AsyncWriteExt + std::marker::Unpin> Responder<W> for TextParser {
|
|||
async fn unparse(&self, response: Response, writer: &mut W) -> io::Result<()> {
|
||||
match response {
|
||||
Response::Help => writer.write_all(HELP_TEXT).await,
|
||||
Response::Protocols(protos) => {
|
||||
for protocol in protos {
|
||||
match protocol {
|
||||
crate::ProtocolStatus::Enabled(proto) => {
|
||||
writer
|
||||
.write_all(format!("Enabled: {}\n", proto).as_bytes())
|
||||
.await?;
|
||||
}
|
||||
crate::ProtocolStatus::Disabled(proto) => {
|
||||
writer
|
||||
.write_all(format!("Disabled: {}\n", proto).as_bytes())
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Response::Size(x, y) => writer.write_all(format!("SIZE {x} {y}\n").as_bytes()).await,
|
||||
Response::GetPixel(x, y, color) => {
|
||||
writer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue