This commit is contained in:
Candifloss 2024-09-16 00:58:06 +05:30
parent 903647c8df
commit ce4e7a8a43

View File

@ -26,7 +26,7 @@ fn print_notif(msg_body: Body) -> Result<()> {
for (key, value) in hints { for (key, value) in hints {
println!(" {key}: {value:?}"); println!(" {key}: {value:?}");
} }
println!("Expiration Timeout: {expir_timeout} seconds"); println!("Expiration Timeout: {expir_timeout} seconds\n");
Ok(()) Ok(())
} }
@ -45,10 +45,10 @@ async fn main() -> Result<()> {
if let Some(member) = msg.header().member().map(|m| m.as_str()) { if let Some(member) = msg.header().member().map(|m| m.as_str()) {
match member { match member {
"GetServerInformation" => { "GetServerInformation" => {
println!("Member is: {member}");
// Respond with server information // Respond with server information
let response = ("SNot", "candifloss.cc", "0.1.0", "1.0"); // (name, vendor, version, spec_version) let response = ("SNot", "candifloss.cc", "0.1.0", "0.1.0"); // (name, vendor, version, spec_version)
connection.reply(&msg, &response).await?; connection.reply(&msg, &response).await?;
println!("Request received: {member}\n\tName: SNot\n\tVendor: candifloss.cc\n\tVersion: 0.1.0\n\tSpec_version: 0.1.0");
} }
"Notify" => { "Notify" => {
println!("Member is: {member}"); println!("Member is: {member}");