-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f27c53
commit e0074f1
Showing
5 changed files
with
31 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1 @@ | ||
use std::collections::HashMap; | ||
|
||
use xml::serialize_invocation; | ||
|
||
pub(crate) mod xml; | ||
|
||
#[derive(Debug, Default, Clone)] | ||
pub struct Invocation { | ||
pub action: String, | ||
pub attributes: Option<HashMap<String, String>>, | ||
pub payload: Option<String>, | ||
|
||
serialized: String, | ||
} | ||
|
||
impl Invocation { | ||
pub fn new( | ||
action: String, | ||
attributes: Option<HashMap<String, String>>, | ||
payload: Option<String>, | ||
) -> Self { | ||
let mut zelf = Self { | ||
action, | ||
attributes, | ||
payload, | ||
serialized: "".to_string(), | ||
}; | ||
zelf.serialized = serialize_invocation(&zelf); | ||
zelf | ||
} | ||
|
||
pub fn as_serialized_str(&self) -> &str { | ||
return self.serialized.as_str(); | ||
} | ||
|
||
pub fn is_same(&self, other: &Invocation) -> bool { | ||
self.serialized == other.serialized | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters