WIP clientbound

This commit is contained in:
Aram 🍐 2021-08-03 22:21:46 -04:00
parent dab761acb7
commit 50b2d3190e
2 changed files with 40 additions and 0 deletions

35
rups/src/proto/client.rs Normal file
View file

@ -0,0 +1,35 @@
use crate::proto::impl_sentences;
impl_sentences! {
/// Server responds with the number of prior logins to the given `ups_name` device.
RespondNumLogins (
{
0: NumLogins,
1: Arg,
2: Arg,
3: EOL,
},
{
/// The name of the UPS device.
1: ups_name,
/// The number of logins to the UPS device.
2: num_logins,
}
),
}
#[cfg(test)]
mod tests {
use super::Sentences;
use crate::proto::test_encode_decode;
#[test]
fn test_encode_decode() {
test_encode_decode!(
["NUMLOGINS", "nutdev", "42"] <=>
Sentences::RespondNumLogins {
ups_name: "nutdev".into(),
num_logins: "42".into(),
}
);
}
}

View file

@ -1,3 +1,8 @@
/// Client-bound protocol implementation.
///
/// "Client-bound" implies commands RECEIVED and DECODED by the client. The server implementation
/// must use the same messages to ENCODE and SEND.
pub mod client;
/// Server-bound protocol implementation.
///
/// "Server-bound" implies commands RECEIVED and DECODED by the server. The client implementation