1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use ruma_common::serde::StringEnum;
use crate::PrivOwnedStr;
pub mod get_hash_parameters;
pub mod lookup_3pid;
#[derive(Clone, PartialEq, Eq, StringEnum)]
#[non_exhaustive]
#[ruma_enum(rename_all = "snake_case")]
pub enum IdentifierHashingAlgorithm {
Sha256,
None,
#[doc(hidden)]
_Custom(PrivOwnedStr),
}
#[cfg(test)]
mod test {
use super::IdentifierHashingAlgorithm;
#[test]
fn parse_identifier_hashing_algorithm() {
assert_eq!(IdentifierHashingAlgorithm::from("sha256"), IdentifierHashingAlgorithm::Sha256);
assert_eq!(IdentifierHashingAlgorithm::from("none"), IdentifierHashingAlgorithm::None);
}
}