mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
hashes: Implement serialise.
This commit is contained in:
parent
78e8a06ec2
commit
20949c2832
1 changed files with 8 additions and 0 deletions
|
@ -28,6 +28,14 @@ pub fn parse_hash(root: &Element) -> Result<Hash, Error> {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn serialise(hash: &Hash) -> Element {
|
||||||
|
Element::builder("hash")
|
||||||
|
.ns(ns::HASHES)
|
||||||
|
.attr("algo", hash.algo.clone())
|
||||||
|
.append(hash.hash.clone())
|
||||||
|
.build()
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use minidom::Element;
|
use minidom::Element;
|
||||||
|
|
Loading…
Reference in a new issue