docs: add rustdoc comments

This commit is contained in:
Greg Heartsfield
2021-12-11 21:43:41 -06:00
parent 04850506a8
commit ca0f01c94b
8 changed files with 157 additions and 100 deletions
+6 -6
View File
@@ -1,14 +1,20 @@
//! Subscription close request parsing
use crate::error::{Error, Result};
use serde::{Deserialize, Serialize};
/// Close command in network format
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct CloseCmd {
/// Protocol command, expected to always be "CLOSE".
cmd: String,
/// The subscription identifier being closed.
id: String,
}
/// Close command parsed
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct Close {
/// The subscription identifier being closed.
pub id: String,
}
@@ -22,9 +28,3 @@ impl From<CloseCmd> for Result<Close> {
}
}
}
impl Close {
pub fn get_id(&self) -> String {
self.id.clone()
}
}