diff options
Diffstat (limited to '')
| -rw-r--r-- | src/message/signalproxy/objects/aliasmanager.rs | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/message/signalproxy/objects/aliasmanager.rs b/src/message/signalproxy/objects/aliasmanager.rs index 7e9cfca..828caaa 100644 --- a/src/message/signalproxy/objects/aliasmanager.rs +++ b/src/message/signalproxy/objects/aliasmanager.rs @@ -11,36 +11,36 @@ pub struct Alias { expansion: String, } -// impl AliasManager { -// /// Client to Server -// /// -// /// Replaces all properties of the object with the content of the -// /// "properties" parameter. This parameter is in network representation. -// /// -// fn request_update(self: Self, properties: VariantMap) { -// self.update(properties); -// } -// -// /// Server to Client -// fn add_alias(self: Self, name: String, expansion: String) { -// self.aliases.push(Alias { name, expansion }); -// } -// -// /// Server to Client -// /// -// /// Replaces all properties of the object with the content of the -// /// "properties" parameter. This parameter is in network representation. -// /// -// fn update(self: Self, properties: VariantMap) { -// let mut alias: Vec<Alias> = Vec::new(); -// -// // for (i, name) in match_variant!(properties[&"Aliases".to_string()], Variant::String) { -// // alias.push(Alias { -// // name, -// // expansion: match_variant!(properties["Aliases"], Variant::String)["expansions"][i], -// // }) -// // } -// -// self.aliases = alias -// } -// } +impl AliasManager { + /// Client to Server + /// + /// Replaces all properties of the object with the content of the + /// "properties" parameter. This parameter is in network representation. + /// + fn request_update(self: &mut Self, properties: VariantMap) { + self.update(properties); + } + + /// Server to Client + fn add_alias(self: &mut Self, name: String, expansion: String) { + self.aliases.push(Alias { name, expansion }); + } + + /// Server to Client + /// + /// Replaces all properties of the object with the content of the + /// "properties" parameter. This parameter is in network representation. + /// + fn update(self: &mut Self, properties: VariantMap) { + let mut alias: Vec<Alias> = Vec::new(); + + // for (i, name) in match_variant!(properties[&"Aliases".to_string()], Variant::String) { + // alias.push(Alias { + // name, + // expansion: match_variant!(properties["Aliases"], Variant::String)["expansions"][i], + // }) + // } + + self.aliases = alias + } +} |
