Add `family_name` to command transaction handler
Add a `family_name` field to the CommandTransactionHandler struct and
set the value with COMMAND_FAMILY_NAME when creating a new
CommandTransactionHandler.
@@ -30,6 +30,7 @@ const COMMAND_VERSION: &str = "1";
#[derive(Default)]
pub struct CommandTransactionHandler {
+ family_name: String,
versions: Vec<String>,
namespaces: Vec<String>,
}
@@ -37,6 +38,7 @@ pub struct CommandTransactionHandler {
impl CommandTransactionHandler {
pub fn new() -> Self {
CommandTransactionHandler {
+ family_name: COMMAND_FAMILY_NAME.to_string(),
versions: vec![COMMAND_VERSION.to_owned()],
namespaces: vec![COMMAND_NAMESPACE.to_owned()],
}
@@ -49,7 +51,7 @@ impl CommandTransactionHandler {
impl TransactionHandler for CommandTransactionHandler {
fn family_name(&self) -> &str {
- COMMAND_FAMILY_NAME
+ &self.family_name
}
fn family_versions(&self) -> &[String] {
